Skip to content

Commit

Permalink
Reset column info after making Topic tz-aware
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gmcgibbon committed Feb 18, 2019
1 parent ccaa619 commit 08e78ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions activerecord/test/cases/attribute_methods_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,10 @@ def topic.title() "b" end
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
Expand Down

0 comments on commit 08e78ad

Please sign in to comment.