aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-03-06 09:39:50 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-03-06 09:39:50 +0000
commit7b9824f6e2b4df7e8b6abf8720270ae755712895 (patch)
tree568c89a1f3b653b646d98e595e5af8a4a56c58fb /activerecord/lib
parent1e9e198cc5c053a9137de78d524412105ac20065 (diff)
downloadrails-7b9824f6e2b4df7e8b6abf8720270ae755712895.tar.gz
rails-7b9824f6e2b4df7e8b6abf8720270ae755712895.tar.bz2
rails-7b9824f6e2b4df7e8b6abf8720270ae755712895.zip
Oracle: overflow Time to DateTime. Closes #7718.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/oracle_adapter.rb7
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