Module: Mongoid::Persistence::Deletion
- Included in:
- Operations::Embedded::Remove, Operations::Remove
- Defined in:
- lib/mongoid/persistence/deletion.rb
Overview
Contains common logic for delete operations.
Instance Method Summary collapse
-
#prepare(&block) {|document| ... } ⇒ true
Wrap all the common delete logic for both root and embedded documents and then yield to the block.
Instance Method Details
#prepare(&block) {|document| ... } ⇒ true
Wrap all the common delete logic for both root and embedded documents and then yield to the block.
21 22 23 24 25 26 27 28 29 |
# File 'lib/mongoid/persistence/deletion.rb', line 21 def prepare(&block) document.cascade! yield(document) document.freeze document.destroyed = true IdentityMap.remove(document) Threaded. true end |