diff options
author | Matthew Draper <matthew@trebex.net> | 2014-06-05 23:35:14 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2014-06-05 23:35:14 +0930 |
commit | e496a25251dc9c1b455bf9e97baaf58b0e99840b (patch) | |
tree | 9000a5c916361a7345b75b558f1f052eb1924b2a /activerecord/test | |
parent | 1c39310637599df879c0412672f35d3990b61afb (diff) | |
parent | f4bd67b687ba1a2a6f907939ea44717b41a505e1 (diff) | |
download | rails-e496a25251dc9c1b455bf9e97baaf58b0e99840b.tar.gz rails-e496a25251dc9c1b455bf9e97baaf58b0e99840b.tar.bz2 rails-e496a25251dc9c1b455bf9e97baaf58b0e99840b.zip |
Merge pull request #15521 from edogawaconan/fix_bc_postgres_master
Fix BC year handling in postgres
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/timestamp_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/timestamp_test.rb b/activerecord/test/cases/adapters/postgresql/timestamp_test.rb index d4102bf7be..3614b29190 100644 --- a/activerecord/test/cases/adapters/postgresql/timestamp_test.rb +++ b/activerecord/test/cases/adapters/postgresql/timestamp_test.rb @@ -123,6 +123,18 @@ class TimestampTest < ActiveRecord::TestCase assert_equal date, Developer.find_by_name("aaron").updated_at end + def test_bc_timestamp_leap_year + date = Time.utc(-4, 2, 29) + Developer.create!(:name => "taihou", :updated_at => date) + assert_equal date, Developer.find_by_name("taihou").updated_at + end + + def test_bc_timestamp_year_zero + date = Time.utc(0, 4, 7) + Developer.create!(:name => "yahagi", :updated_at => date) + assert_equal date, Developer.find_by_name("yahagi").updated_at + end + private def pg_datetime_precision(table_name, column_name) |