aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-11-21 09:34:55 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-11-21 09:34:55 -0800
commit1c0e7ab2f8227598cd605e3cee74e16d66c17c43 (patch)
treedcb7edce622bb316309288f8893983fa107dfd52 /activerecord/test
parent6b266c21b2cc649505e5f31c74e1f450f3287981 (diff)
parentfa73cf727521e9eb7911ada4d30ac10406446e7d (diff)
downloadrails-1c0e7ab2f8227598cd605e3cee74e16d66c17c43.tar.gz
rails-1c0e7ab2f8227598cd605e3cee74e16d66c17c43.tar.bz2
rails-1c0e7ab2f8227598cd605e3cee74e16d66c17c43.zip
Merge pull request #6245 from bogdan/bc_timestamp
Postgresql adapter: fix handling of BC timestamps
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/adapters/postgresql/timestamp_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/timestamp_test.rb b/activerecord/test/cases/adapters/postgresql/timestamp_test.rb
index 26507ad654..630bdeec67 100644
--- a/activerecord/test/cases/adapters/postgresql/timestamp_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/timestamp_test.rb
@@ -75,6 +75,15 @@ class TimestampTest < ActiveRecord::TestCase
assert_equal '4', pg_datetime_precision('foos', 'updated_at')
end
+ def test_bc_timestamp
+ unless current_adapter?(:PostgreSQLAdapter)
+ return skip("only tested on postgresql")
+ end
+ date = Date.new(0) - 1.second
+ Developer.create!(:name => "aaron", :updated_at => date)
+ assert_equal date, Developer.find_by_name("aaron").updated_at
+ end
+
private
def pg_datetime_precision(table_name, column_name)