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
140 141 142 |
# File 'lib/mongoid/paranoia.rb', line 140 def criteria( = false, scoped = true) scoped ? super.where(:deleted_at => nil) : super end |
#deleted ⇒ Criteria
Find deleted documents
154 155 156 |
# File 'lib/mongoid/paranoia.rb', line 154 def deleted where(:deleted_at.ne => nil) end |