aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2017-07-04 16:20:51 -0400
committerGitHub <noreply@github.com>2017-07-04 16:20:51 -0400
commitf01eb5b92c80b7a78bb6b1d9d713a2b8d2cf90d8 (patch)
treeca2968e15a6f5a52fee641ab69e382717691788c /activerecord
parent9b3054384b3233c6be4284779010997ab7bc15b5 (diff)
parent99b4c4ccdbbfc54a9f5eb8809edae9392e4ab2ab (diff)
downloadrails-f01eb5b92c80b7a78bb6b1d9d713a2b8d2cf90d8.tar.gz
rails-f01eb5b92c80b7a78bb6b1d9d713a2b8d2cf90d8.tar.bz2
rails-f01eb5b92c80b7a78bb6b1d9d713a2b8d2cf90d8.zip
Merge pull request #29667 from kamipo/add_missing_attr_name_to_s
Add missing `attr_name.to_s` in `AttributeMutationTracker`
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/attribute_mutation_tracker.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attribute_mutation_tracker.rb b/activerecord/lib/active_record/attribute_mutation_tracker.rb
index 4de993e169..a01a58f8a5 100644
--- a/activerecord/lib/active_record/attribute_mutation_tracker.rb
+++ b/activerecord/lib/active_record/attribute_mutation_tracker.rb
@@ -26,6 +26,7 @@ module ActiveRecord
end
def change_to_attribute(attr_name)
+ attr_name = attr_name.to_s
if changed?(attr_name)
[attributes[attr_name].original_value, attributes.fetch_value(attr_name)]
end
@@ -44,7 +45,7 @@ module ActiveRecord
end
def changed_in_place?(attr_name)
- attributes[attr_name].changed_in_place?
+ attributes[attr_name.to_s].changed_in_place?
end
def forget_change(attr_name)
@@ -54,7 +55,7 @@ module ActiveRecord
end
def original_value(attr_name)
- attributes[attr_name].original_value
+ attributes[attr_name.to_s].original_value
end
def force_change(attr_name)