提交 226a2a90 编写于 作者: R Ryan Bigg

Query guide: class methods are still available on associations

上级 0644e38c
......@@ -801,7 +801,11 @@ class Post < ActiveRecord::Base
end
</ruby>
Using a class method is the preferred way to accept arguments for scopes.
Using a class method is the preferred way to accept arguments for scopes. These methods will still be accessible on the association objects:
<ruby>
category.posts.1_week_before(time)
</ruby>
h3. Dynamic Finders
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册