diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb index 6d6650ba5721f22b9fded6f342c0f3b1c7d07946..cba294d54bd6b9ed5f0f3076fc9aa97c0200a0af 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -365,9 +365,6 @@ def normalize_reflection_attribute(indexed_attribute, reflection, index, attribu # Is used as a before_save callback to check while saving a collection # association whether or not the parent was a new record before saving. def before_save_collection_association - # If we defined a callback that updates the object before we defined the association, then this ivar may end up being - # manipulated to being `false` when it should be `true`. We guard this be only defining it once. - # See https://github.com/rails/rails/issues/38120 for more details unless defined?(@new_record_before_save) @new_record_before_save = new_record? end