aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-03-16 08:25:37 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-03-16 08:25:37 +0000
commitdb69c9c12a4b24f6ca8bc186851cc3873303584c (patch)
tree94119383edbd491122c49e1aba87ad2cfe58744d /activerecord/lib/active_record/connection_adapters
parent814dd007e51f34299b767528f5dfc36cb4b69be3 (diff)
downloadrails-db69c9c12a4b24f6ca8bc186851cc3873303584c.tar.gz
rails-db69c9c12a4b24f6ca8bc186851cc3873303584c.tar.bz2
rails-db69c9c12a4b24f6ca8bc186851cc3873303584c.zip
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
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb10
1 files changed, 0 insertions, 10 deletions
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