提交 7fdab444 编写于 作者: M Michael Koziarski

Remove broken attempts at handling columns with a a default of 'now()' in the...

Remove broken attempts at handling columns with a a default of 'now()' in the postgresql adapter. Closes #2257


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3913 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 504ab568
*SVN*
* Remove broken attempts at handling columns with a a default of 'now()' in the postgresql adapter. #2257 [Koz]
* Added connection#current_database that'll return of the current database (only works in MySQL, SQL Server, and Oracle so far -- please help implement for the rest of the adapters) #3663 [Tom ward]
* Fixed that Migration#execute would have the table name prefix appended to its query #4110 [mark.imbriaco@pobox.com]
......
......@@ -475,9 +475,6 @@ def default_value(value)
# Numeric values
return value if value =~ /^-?[0-9]+(\.[0-9]*)?/
# Date / Time magic values
return Time.now.to_s if value =~ /^now\(\)|^\('now'::text\)::(date|timestamp)/i
# Fixed dates / times
return $1 if value =~ /^'(.+)'::(date|timestamp)/
......
......@@ -809,17 +809,6 @@ def test_bignum
def test_default
default = Default.new
# CURRENT_TIMESTAMP and NOW() timestamps
time_format = "%m/%d/%Y %H:%M"
now = Time.now.strftime(time_format)
assert_equal now, default.modified_time.strftime(time_format)
assert_equal now, default.modified_time_function.strftime(time_format)
# CURRENT_DATE and NOW() dates
today = Date.today
assert_equal today, default.modified_date
assert_equal today, default.modified_date_function
# fixed dates / times
assert_equal Date.new(2004, 1, 1), default.fixed_date
assert_equal Time.local(2004, 1,1,0,0,0,0), default.fixed_time
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册