提交 96b81921 编写于 作者: J Jon Leighton

remove irrelevant references to ARel

上级 13b3c77e
......@@ -979,9 +979,9 @@ If, in the case of this +includes+ query, there were no comments for any posts,
h3. Scopes
Scoping allows you to specify commonly-used ARel queries which can be referenced as method calls on the association objects or models. With these scopes, you can use every method previously covered such as +where+, +joins+ and +includes+. All scope methods will return an +ActiveRecord::Relation+ object which will allow for further methods (such as other scopes) to be called on it.
Scoping allows you to specify commonly-used queries which can be referenced as method calls on the association objects or models. With these scopes, you can use every method previously covered such as +where+, +joins+ and +includes+. All scope methods will return an +ActiveRecord::Relation+ object which will allow for further methods (such as other scopes) to be called on it.
To define a simple scope, we use the +scope+ method inside the class, passing the ARel query that we'd like run when this scope is called:
To define a simple scope, we use the +scope+ method inside the class, passing the query that we'd like run when this scope is called:
<ruby>
class Post < ActiveRecord::Base
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册