Permalink
Browse files

Merge pull request #13514 from kuldeepaggarwal/f-removed-warnings

Removed warnings: setting `changed_attributes` instance variable if it is already initialized.
  • Loading branch information...
senny committed Dec 28, 2013
2 parents c60eddd + e8253d3 commit f66f483d900dfbcb6dfa2df9c6188663489475ab
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/persistence.rb
@@ -181,7 +181,7 @@ def becomes(klass)
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)

0 comments on commit f66f483

Please sign in to comment.