aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-09 15:49:37 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-09 15:49:37 +0000
commit8bf9ec6171fc8de41a1143c9b6f7f002a0790e69 (patch)
tree1cd58fbbaae2bb4bde4e9931d8fab090fa6fd3a0 /activerecord/lib
parent5b983f6f6b92846a0f96757b0dc9e99e3d980df0 (diff)
downloadrails-8bf9ec6171fc8de41a1143c9b6f7f002a0790e69.tar.gz
rails-8bf9ec6171fc8de41a1143c9b6f7f002a0790e69.tar.bz2
rails-8bf9ec6171fc8de41a1143c9b6f7f002a0790e69.zip
Fixed TIMESTAMP columns broken due to TIME handling patch
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@99 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/connection_adapters/abstract_adapter.rb26
1 files changed, 15 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
index 6f4dca1b7b..1a26057528 100755
--- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -182,7 +182,8 @@ module ActiveRecord
when :float then Float
when :datetime then Time
when :date then Date
- when :time then Time
+ when :timestamp then Time
+ when :time then Time
when :text, :string then String
when :boolean then Object
end
@@ -191,14 +192,15 @@ module ActiveRecord
def type_cast(value)
if value.nil? then return nil end
case type
- when :string then value
- when :text then value
- when :integer then value.to_i
- when :float then value.to_f
- when :datetime then string_to_time(value)
- when :time then string_to_dummy_time(value)
- when :date then string_to_date(value)
- when :boolean then (value == "t" or value == true ? true : false)
+ when :string then value
+ when :text then value
+ when :integer then value.to_i
+ when :float then value.to_f
+ when :datetime then string_to_time(value)
+ when :timestamp then string_to_time(value)
+ when :time then string_to_dummy_time(value)
+ when :date then string_to_date(value)
+ when :boolean then (value == "t" or value == true ? true : false)
else value
end
end
@@ -242,8 +244,10 @@ module ActiveRecord
:float
when /datetime/i
:datetime
- when /time/i
- :time
+ when /timestamp/i
+ :timestamp
+ when /time/i
+ :time
when /date/i
:date
when /(c|b)lob/i, /text/i