<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>jypandjip (Jio)</title>
    <link>https://ruby-china.org/jypandjip</link>
    <description/>
    <language>en-us</language>
    <item>
      <title>Rails 2 里的 named_scope,一段值得研究的代码</title>
      <description>&lt;p&gt;有同学对 rails2 的源代码感兴趣吗？前段时间我研究了一下&lt;code&gt;ActiveRecord&lt;/code&gt;里的&lt;code&gt;named_scope&lt;/code&gt;,感觉真的是可以学到很多东西和技巧，相信研究过的同学对会它的实现拍手叫绝，真的是把 ruby 的特性发挥到了极致，在这里我贴出两个 github 链接，感兴趣的同学快去研究研究吧，我个人觉得能读懂这段代码并且在自己的项目中灵活运用，你的编码水平会提高一大截。&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/rails/rails/blob/2-3-stable/activerecord/lib/active_record/named_scope.rb" rel="nofollow" target="_blank"&gt;https://github.com/rails/rails/blob/2-3-stable/activerecord/lib/active_record/named_scope.rb&lt;/a&gt;
&lt;a href="https://github.com/rails/rails/blob/2-3-stable/activerecord/lib/active_record/base.rb#L2132L2190" rel="nofollow" target="_blank"&gt;https://github.com/rails/rails/blob/2-3-stable/activerecord/lib/active_record/base.rb#L2132L2190&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;祝你好运！&lt;/p&gt;</description>
      <author>jypandjip</author>
      <pubDate>Mon, 04 Aug 2014 21:28:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/20839</link>
      <guid>https://ruby-china.org/topics/20839</guid>
    </item>
  </channel>
</rss>
