<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>shatle (刘生)</title>
    <link>https://ruby-china.org/shatle</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>includes 之后，AR 速度反而降低？</title>
      <description>&lt;p&gt;非 includes &lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2016/cea95ef178ba0efa1a5ebf5fa36af645.png!large" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;includes 之后，&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/2016/b8eaadeb4ffaaaa6e0952dfed0727472.png!large" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;AR 耗时反而增加，有什么说法吗？&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;其中，includes 的实体查询中，现有数据记录 &lt;code&gt;id IN (...)&lt;/code&gt; 大约有 5000 条左右，应该不大，但这一查询明显稍微迟延了一下，这部分是否有影响？&lt;/p&gt;

&lt;p&gt;避免了 N+1 的查询，但结果令人 尴尬！&lt;/p&gt;
&lt;h4 id="Update"&gt;Update&lt;/h4&gt;
&lt;p&gt;问题详细些&lt;/p&gt;

&lt;p&gt;由于之前的数据库模型设计上的问题（老系统），需要从两个数据表中，查询出数据，并关联其它数据表 s，计算并得到预警的信息，
非需要预警的记录是不需要的；&lt;/p&gt;

&lt;p&gt;两表的统计字段也是不一样的；&lt;/p&gt;

&lt;p&gt;两表的数据结果是要一起得出，合并的。&lt;/p&gt;

&lt;p&gt;所以，分页 offset 是不太可能的&lt;/p&gt;</description>
      <author>shatle</author>
      <pubDate>Sat, 05 Nov 2016 19:55:50 +0800</pubDate>
      <link>https://ruby-china.org/topics/31527</link>
      <guid>https://ruby-china.org/topics/31527</guid>
    </item>
    <item>
      <title>郑州的工作环境怎么样 </title>
      <description>&lt;p&gt;如题，ruby rails 相关的，想了解一下，谢谢&lt;/p&gt;</description>
      <author>shatle</author>
      <pubDate>Sun, 16 Nov 2014 20:16:25 +0800</pubDate>
      <link>https://ruby-china.org/topics/22708</link>
      <guid>https://ruby-china.org/topics/22708</guid>
    </item>
    <item>
      <title>哪个 forker 改一下？</title>
      <description>&lt;p&gt;&lt;img src="//l.ruby-china.com/photo/24b6127f00f68c50778a94136e7abaa4.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="//l.ruby-china.com/photo/e6363dcf40615582bbce74bae46ab0fd.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;预览的样式和提交后的样式不一样啊&lt;/p&gt;</description>
      <author>shatle</author>
      <pubDate>Sat, 03 Aug 2013 09:07:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/13018</link>
      <guid>https://ruby-china.org/topics/13018</guid>
    </item>
    <item>
      <title>WARNING: Can't verify CSRF token authenticity</title>
      <description>&lt;p&gt;最近出现个问题，之前是没有的，「如题」。&lt;/p&gt;

&lt;p&gt;之前部署时已经参照 &lt;a href="http://stackoverflow.com/questions/7203304/warning-cant-verify-csrf-token-authenticity-rails" rel="nofollow" target="_blank"&gt;http://stackoverflow.com/questions/7203304/warning-cant-verify-csrf-token-authenticity-rails&lt;/a&gt; 做了。&lt;/p&gt;

&lt;p&gt;之前运行是没有这一问题的，我用 firefox 查看：&lt;/p&gt;

&lt;p&gt;&lt;img src="//l.ruby-china.com/photo/1ee5e14c8d250ca3b8864908e201d69c.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;CSRF 已经在 headers 中加上了。&lt;/p&gt;

&lt;p&gt;PUT 出现错误，其它非 GET 操作应该也有这一问题。&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;其实，在我每次更新，从而重新部署时，开始那段时间是没有问题的。但是，过了一段时间（我也不知道大概多久，两三小时／半天？），就会有这一问题。多次出现这一问题了，才不得不在这里占个位！&lt;/p&gt;

&lt;p&gt;谢谢！&lt;/p&gt;</description>
      <author>shatle</author>
      <pubDate>Wed, 31 Jul 2013 13:47:58 +0800</pubDate>
      <link>https://ruby-china.org/topics/12939</link>
      <guid>https://ruby-china.org/topics/12939</guid>
    </item>
    <item>
      <title>唉 最近有点盐</title>
      <description>&lt;p&gt;在酷站中发现个东西&lt;/p&gt;

&lt;p&gt;&lt;img src="//l.ruby-china.com/photo/9741dd19f5001a2e6447f6bbca7cdca4.png" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;友盟有这成绩，是不是你们惯的？哈哈&lt;/p&gt;</description>
      <author>shatle</author>
      <pubDate>Tue, 04 Jun 2013 15:13:36 +0800</pubDate>
      <link>https://ruby-china.org/topics/11476</link>
      <guid>https://ruby-china.org/topics/11476</guid>
    </item>
    <item>
      <title>haml 代码块输出问题</title>
      <description>&lt;p&gt;有一由 markdown 转出来的字符串，&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;pre&amp;gt;&amp;lt;code class=\"lang-ruby\"&amp;gt;class Code\r\n  def hello\r\n  end\r\nend&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;注意中间&lt;code&gt;\r\n&lt;/code&gt;后都只是两个空格的，在 view 中有页面如&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;%div
  = sanitize from_md_string
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;期望浏览器上的结果是&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Code
  def hello
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;但真正显示的是&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Code
                def hello
                end
              end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;后面三行，差了 14 个位，怎么回事？&lt;/p&gt;

&lt;p&gt;我想让实际显示如期望显示的一样。&lt;/p&gt;

&lt;p&gt;在命令行中，测试了 sanitize 方法输出的字符串，仍然是&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;pre&amp;gt;&amp;lt;code class=\"lang-ruby\"&amp;gt;class Code\r\n  def hello\r\n  end\r\nend&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;也就是 sanitize 输出没有错啊，应该！&lt;/p&gt;

&lt;p&gt;又考虑到可能是 css 的原因，但是用了 bootstrap 还是这样子。&lt;/p&gt;

&lt;p&gt;那是不是 haml 的问题呢？查了一下有：&lt;/p&gt;

&lt;p&gt;&lt;a href="http://haml.info/docs/yardoc/file.REFERENCE.html#whitespace_preservation" rel="nofollow" target="_blank"&gt;http://haml.info/docs/yardoc/file.REFERENCE.html#whitespace_preservation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;但是不知从何下手，麻烦大家帮忙一下！&lt;/p&gt;</description>
      <author>shatle</author>
      <pubDate>Sun, 21 Apr 2013 00:40:31 +0800</pubDate>
      <link>https://ruby-china.org/topics/10368</link>
      <guid>https://ruby-china.org/topics/10368</guid>
    </item>
  </channel>
</rss>
