lib/mongoid/fields.rb in mongoid-6.4.8 vs lib/mongoid/fields.rb in mongoid-7.0.0.beta

- old
+ new

@@ -459,10 +459,10 @@ def create_field_setter(name, meth, field) generated_methods.module_eval do re_define_method("#{meth}=") do |value| val = write_attribute(name, value) if field.foreign_key? - remove_ivar(field.metadata.name) + remove_ivar(field.association.name) end val end end end