Class: MongoMapper::Plugins::Associations::ManyDocumentsProxy
- Inherits:
-
Object
- Object
- MongoMapper::Plugins::Associations::ManyDocumentsProxy
- Defined in:
- lib/mm-nested-attributes.rb
Instance Method Summary collapse
- #save_to_collection_with_delete(options = {}) ⇒ Object (also: #save_to_collection)
Instance Method Details
#save_to_collection_with_delete(options = {}) ⇒ Object Also known as: save_to_collection
23 24 25 26 27 28 29 |
# File 'lib/mm-nested-attributes.rb', line 23 def save_to_collection_with_delete(={}) if @target to_delete = @target.delete_if { |doc| doc.marked_for_destruction? } to_delete.each { |doc| doc.destroy } end save_to_collection_without_delete() end |