Module: Mongoid::Persistable::Destroyable::ClassMethods
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Extended In:
| |
| Defined in: | lib/mongoid/persistable/destroyable.rb |
Instance Method Summary
-
#destroy_all(conditions = nil) ⇒ Integer
Delete all documents given the supplied conditions.
Instance Method Details
#destroy_all(conditions = nil) ⇒ Integer
Delete all documents given the supplied conditions. If no conditions are passed, the entire collection will be dropped for performance benefits. Fires the destroy callbacks if conditions were passed.
# File 'lib/mongoid/persistable/destroyable.rb', line 78
def destroy_all(conditions = nil) where(conditions || {}).destroy end