diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-24 00:05:47 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-24 00:05:47 +0000 |
commit | 32dbf0b72554a9c32074a3f86ac1eabdbe6fbb5b (patch) | |
tree | bab594f36f18a2274087b6dcb42185a135e2a3e2 /activerecord | |
parent | f7cdd26b34912d7d8a031d6b44c19cc259d022e9 (diff) | |
download | rails-32dbf0b72554a9c32074a3f86ac1eabdbe6fbb5b.tar.gz rails-32dbf0b72554a9c32074a3f86ac1eabdbe6fbb5b.tar.bz2 rails-32dbf0b72554a9c32074a3f86ac1eabdbe6fbb5b.zip |
Fixes OCI adapter failure on timezone tests #700
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@778 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/oci_adapter.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/oci_adapter.rb b/activerecord/lib/active_record/connection_adapters/oci_adapter.rb index 8fb57f9c39..1db21d4324 100644 --- a/activerecord/lib/active_record/connection_adapters/oci_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/oci_adapter.rb @@ -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) |