diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2018-10-30 14:03:11 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2018-10-30 14:03:11 -0600 |
commit | 3b2ea8b68352c1c4534ff30a086a16d00e8a12cf (patch) | |
tree | 89e139eb38161e697f31a4ce1d353f8f85059330 | |
parent | b63701e272f3dc932ba7a20127f6dc82b567cfb4 (diff) | |
download | rails-3b2ea8b68352c1c4534ff30a086a16d00e8a12cf.tar.gz rails-3b2ea8b68352c1c4534ff30a086a16d00e8a12cf.tar.bz2 rails-3b2ea8b68352c1c4534ff30a086a16d00e8a12cf.zip |
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.
-rw-r--r-- | activerecord/lib/active_record/persistence.rb | 1 |
1 files changed, 1 insertions, 0 deletions
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 |