Module: Mongoid::Persistable::Deletable::ClassMethods
- Defined in:
- lib/mongoid/persistable/deletable.rb
Instance Method Summary collapse
-
#delete_all(conditions = {}) ⇒ Integer
Delete all documents given the supplied conditions.
Instance Method Details
#delete_all(conditions = {}) ⇒ Integer
Delete all documents given the supplied conditions. If no conditions are passed, the entire collection will be dropped for performance benefits. Does not fire any callbacks.
129 130 131 132 |
# File 'lib/mongoid/persistable/deletable.rb', line 129 def delete_all(conditions = {}) selector = hereditary? ? conditions.merge(discriminator_key.to_sym => discriminator_value) : conditions where(selector).delete end |