Method: MongoMapper::Callbacks#destroy

Defined in:
lib/mongo_mapper/callbacks.rb

#destroyObject

Here we override the destroy method to allow for the before_destroy and after_destroy call-backs. Note that the destroy call is aborted if the before_destroy call-back returns false.

Returns:

  • the result of calling destroy on the document



63
64
65
66
67
68
# File 'lib/mongo_mapper/callbacks.rb', line 63

def destroy #:nodoc:
  return false if callback(:before_destroy) == false
  result = super
  callback(:after_destroy)
  result
end