aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-04-10 13:18:34 +0900
committerGitHub <noreply@github.com>2018-04-10 13:18:34 +0900
commiteb3740dcb0c2cc648aea13116628d257bc7ebc3b (patch)
tree5bb6140ee50973889228418c66d4bd0e04cfea88 /activemodel/lib/active_model
parent36ce219ca08f7768a402f846d202f3c5b370718e (diff)
parent80a09caedc6fa67f95e78e45e7eb954f6b647b2c (diff)
downloadrails-eb3740dcb0c2cc648aea13116628d257bc7ebc3b.tar.gz
rails-eb3740dcb0c2cc648aea13116628d257bc7ebc3b.tar.bz2
rails-eb3740dcb0c2cc648aea13116628d257bc7ebc3b.zip
Merge pull request #32498 from eugeneius/mutation_tracker_merge_changes
Prevent changes_to_save from mutating attributes
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r--activemodel/lib/active_model/attribute_mutation_tracker.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/attribute_mutation_tracker.rb b/activemodel/lib/active_model/attribute_mutation_tracker.rb
index 82d90664c0..6abf37bd44 100644
--- a/activemodel/lib/active_model/attribute_mutation_tracker.rb
+++ b/activemodel/lib/active_model/attribute_mutation_tracker.rb
@@ -27,7 +27,7 @@ module ActiveModel
attr_names.each_with_object({}.with_indifferent_access) do |attr_name, result|
change = change_to_attribute(attr_name)
if change
- result[attr_name] = change
+ result.merge!(attr_name => change)
end
end
end