Module: Mongoid::Paranoia::ClassMethods
- Defined in:
- lib/mongoid/paranoia.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#criteria(embedded = false, scoped = true) ⇒ Criteria
Override the default
Criteria
accessor to only get existing documents. -
#deleted ⇒ Criteria
Find deleted documents.
Instance Method Details
#criteria(embedded = false, scoped = true) ⇒ Criteria
Override the default Criteria
accessor to only get existing documents. Passes all arguments up to NamedScope.criteria
139 140 141 |
# File 'lib/mongoid/paranoia.rb', line 139 def criteria( = false, scoped = true) scoped ? super.where(:deleted_at => nil) : super end |
#deleted ⇒ Criteria
Find deleted documents
153 154 155 |
# File 'lib/mongoid/paranoia.rb', line 153 def deleted where(:deleted_at.ne => nil) end |