<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>fatcat (fatcat)</title>
    <link>https://ruby-china.org/fatcat</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>数据表设计问题，请大佬们指点</title>
      <description>&lt;p&gt;大佬们，我有个数据表需求：&lt;/p&gt;

&lt;p&gt;公司 company 有多个业务 service,  每个业务有多个子业务 sub_service,  子业务 sub_service 会根据公司 company 的不同有不同的设计，有不同的数据项。子业务是在主业务视图下添加创建的。index 显示也是在主业务 service 的 show 页面。&lt;/p&gt;

&lt;p&gt;这里该如何设计？问了 chatgpt，说采用动态关联 Polymorphic Associations。但是它举的例子我没搞明白。&lt;/p&gt;

&lt;p&gt;烦请大佬们提示一二，感谢。&lt;/p&gt;</description>
      <author>fatcat</author>
      <pubDate>Fri, 16 Jun 2023 12:50:39 +0800</pubDate>
      <link>https://ruby-china.org/topics/43178</link>
      <guid>https://ruby-china.org/topics/43178</guid>
    </item>
    <item>
      <title>action_text 内容修改报错问题</title>
      <description>&lt;p&gt;富文本处理采用的原生的 trix，但有个问题，has_rich_text :body，body 内容新建没什么问题，但经常会出现修改 body 中原来的上传的图片，比如删除，重新上传其它的图片。在 update 后会报错，说找不到之前的_blob.&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;Could&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;find&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt; &lt;span class="ss"&gt;blob: &lt;/span&gt;&lt;span class="n"&gt;expected&lt;/span&gt; &lt;span class="n"&gt;attachable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;got&lt;/span&gt; &lt;span class="c1"&gt;#&amp;lt;ActiveStorage::Blob id: 315, key: "kzh9v2l5z58xrpnotwzc9cd5deww", filename: "paper.jpg", content_type: "image/jpeg", metadata: {"identified"=&amp;gt;true, "width"=&amp;gt;640, "height"=&amp;gt;2178, "analyzed"=&amp;gt;true}, service_name: "local", byte_size: 215595, checksum: "G6R6jL4OF9x1xui20FRgLA==", created_at: "2023-06-12 20:15:49.169789000 +0800"&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/fatcat/f47de8d6-0f1a-4814-889a-30c99d95a9c0.png!large" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;这里的 paper.jpeg 早已经在 body 中删除，硬盘上没有删除。
我重新启动 rails server，会正常，但过一会又会出现。
请问是什么原因，查了一圈没有找到解决方法，问了 chatgpt 也答非所问。不知道哪位大佬遇到过类似问题没？&lt;/p&gt;</description>
      <author>fatcat</author>
      <pubDate>Mon, 12 Jun 2023 22:29:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/43170</link>
      <guid>https://ruby-china.org/topics/43170</guid>
    </item>
    <item>
      <title>求助，docker 环境下，docker build 时报错，已经设置 ruby china gem 镜像地址</title>
      <description>&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://gems.ruby-china.com/ due to underlying error &amp;lt;SocketError: Failed to open TCP connection to gems.ruby-china.com:443 (getaddrinfo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Temporary failure in name resolution) (https://gems.ruby-china.com/specs.4.8.gz)&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/fatcat/0d681705-0aea-49de-b1f2-11117fbf1ef2.png!large" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;实际在浏览器中这个 specs 是可以下载的，但就是 docker compose build 的时候报错。
不知有哪位大佬遇到过这种情况？麻烦指点一下，谢谢。&lt;/p&gt;</description>
      <author>fatcat</author>
      <pubDate>Thu, 20 Apr 2023 00:16:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/43021</link>
      <guid>https://ruby-china.org/topics/43021</guid>
    </item>
    <item>
      <title>玩了一下 chatgpt, 挺有意思</title>
      <description>&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/fatcat/045c5da5-1ade-4405-a899-5fda28c1fa28.png!large" title="" alt=""&gt;
&lt;img src="https://l.ruby-china.com/photo/fatcat/83cfb8d3-8a04-4fab-aa4d-7548c929d8f0.png!large" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>fatcat</author>
      <pubDate>Sat, 10 Dec 2022 19:08:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/42786</link>
      <guid>https://ruby-china.org/topics/42786</guid>
    </item>
  </channel>
</rss>
