From 61e50814040d68c640b16afd2b9c419d2f12fad6 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 3 Dec 2015 21:18:57 +0300 Subject: `ActiveRecord::Base#becomes` should copy the errors --- activerecord/lib/active_record/persistence.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/persistence.rb') 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 -- cgit v1.2.3