aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/attribute_methods_test.rb
diff options
context:
space:
mode:
authorGannon McGibbon <gannon.mcgibbon@gmail.com>2019-02-18 17:51:28 -0500
committerGannon McGibbon <gannon.mcgibbon@gmail.com>2019-02-18 17:55:20 -0500
commit08e78ad4ae1507a9ed70f3784370febd84a49592 (patch)
tree533c61f4ca0869032511bd6a5334ed814641bb76 /activerecord/test/cases/attribute_methods_test.rb
parentccaa6199a74906ccb45fadbe1ce6a7e1fdd3d0d1 (diff)
downloadrails-08e78ad4ae1507a9ed70f3784370febd84a49592.tar.gz
rails-08e78ad4ae1507a9ed70f3784370febd84a49592.tar.bz2
rails-08e78ad4ae1507a9ed70f3784370febd84a49592.zip
Reset column info after making Topic tz-aware
In AttributeMethodsTest, we make the global Topic class time zone-aware which changes instance date time attribute casting behaviour. We need to reset column info after the test because future tests don't expect Topic date time columns to be time zone-aware.
Diffstat (limited to 'activerecord/test/cases/attribute_methods_test.rb')
-rw-r--r--activerecord/test/cases/attribute_methods_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb
index d341dd0083..148c9dd347 100644
--- a/activerecord/test/cases/attribute_methods_test.rb
+++ b/activerecord/test/cases/attribute_methods_test.rb
@@ -711,6 +711,10 @@ class AttributeMethodsTest < ActiveRecord::TestCase
record.written_on = "Jan 01 00:00:00 2014"
assert_equal record, YAML.load(YAML.dump(record))
end
+ ensure
+ # NOTE: Reset column info because global topics
+ # don't have tz-aware attributes by default.
+ Topic.reset_column_information
end
test "setting a time zone-aware time in the current time zone" do