From 7b9824f6e2b4df7e8b6abf8720270ae755712895 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 6 Mar 2007 09:39:50 +0000 Subject: Oracle: overflow Time to DateTime. Closes #7718. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../lib/active_record/connection_adapters/oracle_adapter.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb b/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb index 7e6ef121e2..0dc0513356 100644 --- a/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb @@ -507,8 +507,11 @@ begin when OCI8::LOB name == 'Writable Large Object' ? row[i]: row[i].read when OraDate - (row[i].hour == 0 and row[i].minute == 0 and row[i].second == 0) ? - row[i].to_date : row[i].to_time + if emulate_dates && (row[i].hour == 0 && row[i].minute == 0 && row[i].second == 0) + row[i].to_date + else + row[i].to_time rescue row[i].to_datetime + end else row[i] end unless col == 'raw_rnum_' end -- cgit v1.2.3