class Mongoid::Association::Nested::Many
def destroy(parent, relation, doc)
- Since: - 3.0.10
Parameters:
-
doc
(Document
) -- The doc to destroy. -
relation
(Proxy
) -- The relation proxy. -
parent
(Document
) -- The parent document.
Other tags:
- Example: Destroy the child. -
Other tags:
- Api: - private
def destroy(parent, relation, doc) doc.flagged_for_destroy = true if !doc.embedded? || parent.new_record? || doc.paranoid? destroy_document(relation, doc) else parent.flagged_destroys.push(-> { destroy_document(relation, doc) }) end end