aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG2
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb3
-rwxr-xr-xactiverecord/test/base_test.rb11
3 files changed, 2 insertions, 14 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 6f9adae852..7068f83170 100644
--- a/activerecord/CHANGELOG
+++ b/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]
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 86b89c6c1c..354df9a42e 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -475,9 +475,6 @@ module ActiveRecord
# 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)/
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb
index 58dd133aeb..3592c09e23 100755
--- a/activerecord/test/base_test.rb
+++ b/activerecord/test/base_test.rb
@@ -809,17 +809,6 @@ class BasicsTest < Test::Unit::TestCase
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