aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorKuldeep Aggarwal <kd.engineer@yahoo.co.in>2013-12-28 17:05:51 +0530
committerKuldeep Aggarwal <kd.engineer@yahoo.co.in>2013-12-28 17:05:51 +0530
commite8253d3a642d396d9646d082f97eb233a2b2396e (patch)
tree567466ba4d7b036f27ac41de18d70e75a93c5788 /activerecord
parentc60edddc0f75a26a89ba96de47d21e6a59d67e74 (diff)
downloadrails-e8253d3a642d396d9646d082f97eb233a2b2396e.tar.gz
rails-e8253d3a642d396d9646d082f97eb233a2b2396e.tar.bz2
rails-e8253d3a642d396d9646d082f97eb233a2b2396e.zip
setting `changed_attributes` instance variable if it is already initialized.
Diffstat (limited to 'activerecord')
-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 309bb980e3..b94ef18fd5 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -181,7 +181,7 @@ module ActiveRecord
became = klass.new
became.instance_variable_set("@attributes", @attributes)
became.instance_variable_set("@attributes_cache", @attributes_cache)
- became.instance_variable_set("@changed_attributes", @changed_attributes)
+ became.instance_variable_set("@changed_attributes", @changed_attributes) if defined?(@changed_attributes)
became.instance_variable_set("@new_record", new_record?)
became.instance_variable_set("@destroyed", destroyed?)
became.instance_variable_set("@errors", errors)