提交 8bf9ec61 编写于 作者: D David Heinemeier Hansson

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
上级 5b983f6f
......@@ -182,7 +182,8 @@ def klass
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 @@ def klass
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 @@ def simplified_type(field_type)
: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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册