Class: Humanoid::Commands::Destroy

Inherits:
Object
  • Object
show all
Extended by:
Deletion
Defined in:
lib/humanoid/commands/destroy.rb

Class Method Summary collapse

Methods included from Deletion

delete

Class Method Details

.execute(doc) ⇒ Object

Performs a destroy of the supplied Document, with the necessary callbacks. It then deletes the record from the collection.

Options:

doc: A new Document that is going to be destroyed.



12
13
14
15
16
# File 'lib/humanoid/commands/destroy.rb', line 12

def self.execute(doc)
  doc.run_callbacks :before_destroy
  delete(doc)
  doc.run_callbacks :after_destroy
end