aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorDylan Thacker-Smith <Dylan.Smith@shopify.com>2017-08-29 20:12:10 -0400
committerDylan Thacker-Smith <Dylan.Smith@shopify.com>2017-08-30 10:46:01 -0400
commitc342d58446defad94f26c067b19003c9941f2470 (patch)
tree72f9899262e5e75c42b32822d2b528eb9db03f48 /activerecord/lib/active_record/persistence.rb
parent5c2c8d8cfd7fc8ec58c906e192c1d4f305bf7095 (diff)
downloadrails-c342d58446defad94f26c067b19003c9941f2470.tar.gz
rails-c342d58446defad94f26c067b19003c9941f2470.tar.bz2
rails-c342d58446defad94f26c067b19003c9941f2470.zip
activerecord: Remove a redundant mutation tracker
The extra mutation tracker was needed in Rails 5.1 to preserve the old behaviour of `changes`, but now there is no difference between `changes` and `changes_to_save`, so `@mutation_tracker` can be removed.
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index fbbf9082cc..b28f6e96a9 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -228,7 +228,7 @@ module ActiveRecord
def becomes(klass)
became = klass.new
became.instance_variable_set("@attributes", @attributes)
- became.instance_variable_set("@mutation_tracker", @mutation_tracker) if defined?(@mutation_tracker)
+ became.instance_variable_set("@mutations_from_database", @mutations_from_database) if defined?(@mutations_from_database)
became.instance_variable_set("@changed_attributes", attributes_changed_by_setter)
became.instance_variable_set("@new_record", new_record?)
became.instance_variable_set("@destroyed", destroyed?)