Method: MongoMapper::Document::ClassMethods#destroy
- Defined in:
- lib/mongo_mapper/document.rb
#destroy(id) ⇒ Object #destroy(ids) ⇒ Object
Iterates over each document found by the provided IDs and calls their destroy method. This has the advantage of processing your document’s destroy call-backs.
231 232 233 |
# File 'lib/mongo_mapper/document.rb', line 231 def destroy(*ids) find_some(ids.flatten).each(&:destroy) end |