Module: Mongoid::Relations::Embedded::Batchable
- Defined in:
- lib/mongoid/core_ext/relations/embedded/batchable.rb
Instance Method Summary collapse
-
#pre_process_batch_remove(docs, method) ⇒ Array<Hash>
private
Pre process the batch removal.
Instance Method Details
#pre_process_batch_remove(docs, method) ⇒ Array<Hash>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Pre process the batch removal.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mongoid/core_ext/relations/embedded/batchable.rb', line 18 def pre_process_batch_remove(docs, method) docs.map do |doc| self.path = doc.atomic_path unless path execute_callback :before_remove, doc if !_assigning? && !.versioned? doc.cascade! doc.run_before_callbacks(:destroy) if method == :destroy end target.delete_one(doc) _unscoped.delete_one(doc) unbind_one(doc) execute_callback :after_remove, doc doc.as_document end end |