Class: Mongoid::Relations::Builders::NestedAttributes::Many
- Inherits:
-
NestedBuilder
- Object
- NestedBuilder
- Mongoid::Relations::Builders::NestedAttributes::Many
- Defined in:
- lib/mongoid/core_ext/builders/nested_attributes/many.rb
Instance Method Summary collapse
-
#destroy(parent, relation, doc) ⇒ Object
private
Destroy the child document, needs to do some checking for embedded relations and delay the destroy in case parent validation fails.
- #original_destroy ⇒ Object
Instance Method Details
#destroy(parent, relation, doc) ⇒ Object
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.
Destroy the child document, needs to do some checking for embedded relations and delay the destroy in case parent validation fails.
22 23 24 25 26 27 28 |
# File 'lib/mongoid/core_ext/builders/nested_attributes/many.rb', line 22 def destroy(parent, relation, doc) if doc.paranoid? destroy_document(relation, doc) else original_destroy(parent, relation, doc) end end |
#original_destroy ⇒ Object
7 |
# File 'lib/mongoid/core_ext/builders/nested_attributes/many.rb', line 7 alias_method :original_destroy, :destroy |