lib/mongoid/relations/referenced/many_to_many.rb in mongoid-3.0.4 vs lib/mongoid/relations/referenced/many_to_many.rb in mongoid-3.0.5
- old
+ new
@@ -144,9 +144,12 @@
base.send(foreign_key).clear
)
end
target.clear do |doc|
unbind_one(doc)
+ unless metadata.forced_nil_inverse?
+ doc.changed_attributes.delete(inverse_foreign_key)
+ end
end
end
alias :nullify_all :nullify
alias :clear :nullify
alias :purge :nullify