Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 7fdab4446a91824b16ebf52d35dc9c6854276aac 1 parent 504ab56
@NZKoz NZKoz authored
View
2  activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*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]
View
3  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -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)/
View
11 activerecord/test/base_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.