aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/timestamp_test.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-04-05 00:39:37 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2013-04-05 00:43:16 +0100
commit8f84cdd06f85c65c1949ea227285bbdeb47c5b14 (patch)
treea9aaea9a59bc8813ffd0fe8b49e5ded88c4dfe5d /activerecord/test/cases/timestamp_test.rb
parent249876b99bd518f93f5a9f8ae6c4ed7d6fb02936 (diff)
downloadrails-8f84cdd06f85c65c1949ea227285bbdeb47c5b14.tar.gz
rails-8f84cdd06f85c65c1949ea227285bbdeb47c5b14.tar.bz2
rails-8f84cdd06f85c65c1949ea227285bbdeb47c5b14.zip
Use inspect when writing the foreign key from the reflection
If we don't use inspect inside the class_eval block then the foreign key is written without quotes causing us to fetch the foreign key value and not the column name.
Diffstat (limited to 'activerecord/test/cases/timestamp_test.rb')
-rw-r--r--activerecord/test/cases/timestamp_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb
index 0c13bb946a..f42ecbb340 100644
--- a/activerecord/test/cases/timestamp_test.rb
+++ b/activerecord/test/cases/timestamp_test.rb
@@ -192,6 +192,12 @@ class TimestampTest < ActiveRecord::TestCase
old_pet.update_columns(updated_at: time)
new_pet.update_columns(updated_at: time)
+ old_pet.reload
+ new_pet.reload
+
+ assert_equal time, new_pet.updated_at
+ assert_equal time, old_pet.updated_at
+
toy1.pet = new_pet
toy1.save!