Fixes OCI adapter failure on timezone tests #700

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@778 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson
2005-02-24 00:05:47 +00:00
parent f7cdd26b34
commit 32dbf0b725

View File

@@ -55,13 +55,14 @@ begin
def cast_to_date_or_time(value)
return value if value.is_a? Date
guess_date_or_time (value.is_a? Time) ?
value : Time.local(*value.split(/\D+/).map{ |x| x.to_i })
guess_date_or_time (value.is_a? Time) ? value : cast_to_time(value)
end
def cast_to_time(value)
return value if value.is_a? Time
Time.local(2000, 1, 1,*value.split(/\D+/).map{ |x| x.to_i })
time_array = ParseDate.parsedate value
time_array[0] ||= 2000; time_array[1] ||= 1; time_array[2] ||= 1;
Time.send Base.default_timezone, *time_array
end
def guess_date_or_time(value)