From 883292fdca1d9bcc8867b6e2f5173d094aca8e5b Mon Sep 17 00:00:00 2001 From: Chris Salzberg Date: Sun, 25 Apr 2021 22:45:26 +0900 Subject: [PATCH] Make changes_applied public again This was (accidentally?) made private, whereas previously it was public. --- activerecord/lib/active_record/autosave_association.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/activerecord/lib/active_record/autosave_association.rb b/activerecord/lib/active_record/autosave_association.rb index 33646ad54f..774ae49064 100644 --- a/activerecord/lib/active_record/autosave_association.rb +++ b/activerecord/lib/active_record/autosave_association.rb @@ -282,6 +282,11 @@ module ActiveRecord new_record? || has_changes_to_save? || marked_for_destruction? || nested_records_changed_for_autosave? end + def changes_applied # :nodoc: + @_already_called[:changes_applied] = true + super + end + private # Track if this record is currently being saved. # Autosave can call save multiple times on the same record. Some methods @@ -530,11 +535,6 @@ module ActiveRecord errors.uniq! end - def changes_applied - @_already_called[:changes_applied] = true - super - end - # Call +changes_applied+ at least once or if attributes changed def _apply_changes?(attribute_names) !@_already_called[:changes_applied] || attribute_names.present?