提交 c4233a0e 编写于 作者: J Jeremy Kemper

PostgreSQL: correctly quote microseconds in timestamps. Closes #5641.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4579 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 230c5a06
*SVN*
* PostgreSQL: correctly quote microseconds in timestamps. #5641 [rick@rickbradley.com]
* Clearer has_one/belongs_to model names (account has_one :user). #5632 [matt@mattmargolis.net]
* Oracle: use nonblocking queries if allow_concurrency is set, fix pessimistic locking, don't guess date vs. time by default (set OracleAdapter.emulate_dates = true for the old behavior), adapter cleanup. #5635 [schoenm@earthlink.net]
......
......@@ -125,7 +125,7 @@ def quote_column_name(name)
end
def quoted_date(value)
value.strftime("%Y-%m-%d %H:%M:%S.#{value.usec}")
value.strftime("%Y-%m-%d %H:%M:%S.#{sprintf("%06d", value.usec)}")
end
......
......@@ -320,6 +320,7 @@ def test_preserving_time_objects
if current_adapter?(:PostgreSQLAdapter)
assert_equal 11, Topic.find(1).written_on.sec
assert_equal 223300, Topic.find(1).written_on.usec
assert_equal 9900, Topic.find(2).written_on.usec
end
end
......
......@@ -14,7 +14,7 @@ second:
id: 2
title: The Second Topic's of the day
author_name: Mary
written_on: 2003-07-15t15:28:00.00+01:00
written_on: 2003-07-15t15:28:00.0099+01:00
content: Have a nice day
approved: true
replies_count: 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册