Permalink
Browse files

Test that PostgreSQL adapter includes `usec` when quoting `DateTime`

  • Loading branch information...
1 parent 1cb5094 commit 5f631d63ae3bc57119ca2102fc9bc34ad4eb1b7c @bcherry bcherry committed Aug 27, 2013
Showing with 9 additions and 0 deletions.
  1. +4 −0 activerecord/CHANGELOG.md
  2. +5 −0 activerecord/test/cases/adapters/postgresql/quoting_test.rb
View
4 activerecord/CHANGELOG.md
@@ -1,3 +1,7 @@
+* Test that PostgreSQL adapter includes `usec` when quoting `DateTime` objects
+
+ *Ben Cherry*
+
* Fix PredicateBuilder so polymorhic association keys in `where` clause can
also accept not only `ActiveRecord::Base` direct descendances (decorated
models, for example).
View
5 activerecord/test/cases/adapters/postgresql/quoting_test.rb
@@ -52,6 +52,11 @@ def test_quote_cast_numeric
c = Column.new(nil, nil, 'text')
assert_equal "'666'", @conn.quote(fixnum, c)
end
+
+ def test_quote_time_usec
+ assert_equal "'1970-01-01 00:00:00.000000'", @conn.quote(Time.at(0))
+ assert_equal "'1970-01-01 00:00:00.000000'", @conn.quote(Time.at(0).to_datetime)
+ end
end
end
end

0 comments on commit 5f631d6

Please sign in to comment.