Method: Mongoid::Scopable::ClassMethods#default_scope
- Defined in:
- lib/mongoid/scopable.rb
#default_scope(value) ⇒ Proc
Add a default scope to the model. This scope will be applied to all criteria unless #unscoped is specified.
90 91 92 93 |
# File 'lib/mongoid/scopable.rb', line 90 def default_scope(value) check_scope_validity(value) self.default_scoping = process_default_scope(value) end |