Method: MongoMapper::Plugins::Associations::ManyDocumentsProxy#nullify

Defined in:
lib/mongo_mapper/plugins/associations/many_documents_proxy.rb

#nullifyObject



83
84
85
86
87
88
89
# File 'lib/mongo_mapper/plugins/associations/many_documents_proxy.rb', line 83

def nullify
  criteria = Query.new(klass, scoped_conditions).criteria
  all(criteria).each do |doc|
    doc.update_attributes(self.foreign_key => nil)
  end
  reset
end