aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorVokhmin Alexey V <avokhmin@gmail.com>2015-12-03 21:18:57 +0300
committerVokhmin Alexey V <avokhmin@gmail.com>2015-12-14 19:02:20 +0300
commit61e50814040d68c640b16afd2b9c419d2f12fad6 (patch)
treeac4d6a8ec0694b968670fc5d872a6b258f0410b3 /activerecord/lib/active_record/persistence.rb
parent574f255629a45cd67babcfb9bb8e163e091a53b8 (diff)
downloadrails-61e50814040d68c640b16afd2b9c419d2f12fad6.tar.gz
rails-61e50814040d68c640b16afd2b9c419d2f12fad6.tar.bz2
rails-61e50814040d68c640b16afd2b9c419d2f12fad6.zip
`ActiveRecord::Base#becomes` should copy the errors
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 9e566031b8..522c35252f 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -215,7 +215,7 @@ module ActiveRecord
became.instance_variable_set("@changed_attributes", attributes_changed_by_setter)
became.instance_variable_set("@new_record", new_record?)
became.instance_variable_set("@destroyed", destroyed?)
- became.instance_variable_set("@errors", errors)
+ became.errors.copy!(errors)
became
end