mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Don't call changes in changes_applied
unless required
This is an alternate implementation of #31698. That PR makes assumptions that I do not want in the code base. We can fix the performance regression with a much simpler patch.
This commit is contained in:
parent
5fcbdcfb57
commit
e126078a0e
1 changed files with 3 additions and 1 deletions
|
@ -142,7 +142,9 @@ module ActiveModel
|
|||
end
|
||||
|
||||
def changes_applied # :nodoc:
|
||||
@previously_changed = changes
|
||||
unless defined?(@attributes)
|
||||
@previously_changed = changes
|
||||
end
|
||||
@mutations_before_last_save = mutations_from_database
|
||||
@attributes_changed_by_setter = ActiveSupport::HashWithIndifferentAccess.new
|
||||
forget_attribute_assignments
|
||||
|
|
Loading…
Reference in a new issue