Module: Humanoid::Commands::Deletion
Overview
:nodoc
Instance Method Summary collapse
-
#delete(doc) ⇒ Object
If the
Document
has a parent, delete it from the parent’s attributes, otherwise delete it from it’s collection.
Instance Method Details
#delete(doc) ⇒ Object
If the Document
has a parent, delete it from the parent’s attributes, otherwise delete it from it’s collection.
7 8 9 10 11 12 13 14 15 |
# File 'lib/humanoid/commands/deletion.rb', line 7 def delete(doc) parent = doc._parent if parent parent.remove(doc) parent.save else doc.collection.remove(:_id => doc.id) end end |