Module | ActiveRecord::NamedScope |
In: |
lib/active_record/named_scope.rb
|
All subclasses of ActiveRecord::Base have one named scope:
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.