From 3b2ea8b68352c1c4534ff30a086a16d00e8a12cf Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Tue, 30 Oct 2018 14:03:11 -0600 Subject: Fix failing test b63701e moved the assignment before the query, but we need to capture our old id before assignment in case we are assigning the id. --- activerecord/lib/active_record/persistence.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index f991a3076e..7bf8d568df 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -479,6 +479,7 @@ module ActiveRecord verify_readonly_attribute(key.to_s) end + id_in_database = self.id_in_database attributes.each do |k, v| write_attribute_without_type_cast(k, v) end -- cgit v1.2.3