diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/oracle_adapter.rb | 7 |
1 files changed, 5 insertions, 2 deletions
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 |