aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2015-12-14 09:53:16 -0700
committerSean Griffin <sean@seantheprogrammer.com>2015-12-14 09:53:16 -0700
commit8d672a5f924493b8d7dd9074a41a065aa130c557 (patch)
treefc8e247e7688e0b12d407bd954583b028b1fcea0 /activerecord/lib/active_record
parent6d5b1fdf55611de2a1071c37544933bb588ae88e (diff)
parent61e50814040d68c640b16afd2b9c419d2f12fad6 (diff)
downloadrails-8d672a5f924493b8d7dd9074a41a065aa130c557.tar.gz
rails-8d672a5f924493b8d7dd9074a41a065aa130c557.tar.bz2
rails-8d672a5f924493b8d7dd9074a41a065aa130c557.zip
Merge pull request #22395 from avokhmin/becomes-errors-base-2
`ActiveRecord::Base#becomes` should copy the errors
Diffstat (limited to 'activerecord/lib/active_record')
-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