From db69c9c12a4b24f6ca8bc186851cc3873303584c Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 16 Mar 2007 08:25:37 +0000 Subject: PostgreSQL: remove DateTime -> Time downcast. Bypass the DateTime migration test on 64-bit platforms since it may be a Time. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6433 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../active_record/connection_adapters/postgresql_adapter.rb | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index c4bd2c8a04..3fb1655526 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -451,8 +451,6 @@ module ActiveRecord case res.type(cel_index) when BYTEA_COLUMN_TYPE_OID column = unescape_bytea(column) - when TIMESTAMPTZOID, TIMESTAMPOID - column = cast_to_time(column) when NUMERIC_COLUMN_TYPE_OID column = column.to_d if column.respond_to?(:to_d) end @@ -579,14 +577,6 @@ module ActiveRecord # and we can't know the value of that, so return nil. return nil end - - # Only needed for DateTime instances - def cast_to_time(value) - return value unless value.class == DateTime - v = value - time_array = [v.year, v.month, v.day, v.hour, v.min, v.sec, v.usec] - Time.send(Base.default_timezone, *time_array) rescue nil - end end end end -- cgit v1.2.3