Permalink
Browse files

Fixes OCI adapter failure on timezone tests #700

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@778 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
dhh committed Feb 24, 2005
1 parent f7cdd26 commit 32dbf0b72554a9c32074a3f86ac1eabdbe6fbb5b
Showing with 4 additions and 3 deletions.
  1. +4 −3 activerecord/lib/active_record/connection_adapters/oci_adapter.rb
@@ -55,13 +55,14 @@ def type_cast(value)
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)

0 comments on commit 32dbf0b

Please sign in to comment.