提交 ff894b55 编写于 作者: Z Zack Hobson 提交者: David Heinemeier Hansson

Update rdoc: all is not a named_scope [#1959 state:committed]

Signed-off-by: NDavid Heinemeier Hansson <david@loudthinking.com>
上级 319106d0
module ActiveRecord
module NamedScope
# All subclasses of ActiveRecord::Base have two named \scopes:
# * <tt>all</tt> - which is similar to a <tt>find(:all)</tt> query, and
# All subclasses of ActiveRecord::Base have one named scope:
# * <tt>scoped</tt> - which allows for the creation of anonymous \scopes, on the fly: <tt>Shirt.scoped(:conditions => {:color => 'red'}).scoped(:include => :washing_instructions)</tt>
#
# These anonymous \scopes tend to be useful when procedurally generating complex queries, where passing
# intermediate values (scopes) around as first-class objects is convenient.
#
# You can define a scope that applies to all finders using ActiveRecord::Base.default_scope.
def self.included(base)
base.class_eval do
extend ClassMethods
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册