Module: Mongoid::Persistable::Destroyable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Mongoid::Persistable
- Defined in:
- lib/mongoid/persistable/destroyable.rb
Overview
Defines behaviour for persistence operations that destroy documents.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#destroy(options = {}) ⇒ true, false
Remove the document from the database with callbacks.
Instance Method Details
#destroy(options = {}) ⇒ true, false
Remove the document from the database with callbacks.
21 22 23 24 25 26 |
# File 'lib/mongoid/persistable/destroyable.rb', line 21 def destroy( = {}) self.flagged_for_destroy = true result = run_callbacks(:destroy) { delete() } self.flagged_for_destroy = false result end |