diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-06-07 09:38:15 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-06-07 09:38:15 -0600 |
commit | 3b22df2350dd671436ca5b1e4de4af3df9a8cca2 (patch) | |
tree | 8808ad0d2c04b0ded40b60a04c9562be84bd720f /activerecord/test | |
parent | 2f5fab8d5af6dfe59e73fcf3d8d9902715b4284b (diff) | |
download | rails-3b22df2350dd671436ca5b1e4de4af3df9a8cca2.tar.gz rails-3b22df2350dd671436ca5b1e4de4af3df9a8cca2.tar.bz2 rails-3b22df2350dd671436ca5b1e4de4af3df9a8cca2.zip |
Ensure time zones don't change after round trip with array columns
The times would be equivalent, even if they were in different time
zones. E.g. 12:00 UTC == 5:00 PDT
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/array_test.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/array_test.rb b/activerecord/test/cases/adapters/postgresql/array_test.rb index c78c502478..1d431f1666 100644 --- a/activerecord/test/cases/adapters/postgresql/array_test.rb +++ b/activerecord/test/cases/adapters/postgresql/array_test.rb @@ -208,11 +208,13 @@ class PostgresqlArrayTest < ActiveRecord::TestCase record = PgArray.new(datetimes: [time_string]) assert_equal [time], record.datetimes + assert_equal ActiveSupport::TimeZone[tz], record.datetimes.first.time_zone record.save! record.reload assert_equal [time], record.datetimes + assert_equal ActiveSupport::TimeZone[tz], record.datetimes.first.time_zone end end |