summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-09-11 10:23:29 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-09-11 10:23:29 +0200
commitb7198c1980800a2473bcbc6232b03536f4bc01f8 (patch)
treec0b7c68054b251fcbdef9d4aeaca20ff03584ea6
parent5678e3dd715d6a11c27e3da66f6717519e3e81dc (diff)
downloadsonarqube-b7198c1980800a2473bcbc6232b03536f4bc01f8.tar.gz
sonarqube-b7198c1980800a2473bcbc6232b03536f4bc01f8.zip
SONAR-3542 fix the DATE type on Oracle
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/oracle/adapter.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/oracle/adapter.rb b/sonar-server/src/main/webapp/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/oracle/adapter.rb
index c27a4f2d714..3486a58887b 100644
--- a/sonar-server/src/main/webapp/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/oracle/adapter.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.1.3/lib/arjdbc/oracle/adapter.rb
@@ -382,7 +382,9 @@ module ::ArJdbc
end
quoted = super
#sonar
- if value.acts_like?(:date) || value.acts_like?(:time) || value.acts_like?(:timestamp)
+ if value.acts_like?(:date)
+ quoted = "TO_DATE('#{value.strftime('%Y-%m-%d')}','YYYY-MM-DD')"
+ elsif value.acts_like?(:time) || value.acts_like?(:timestamp)
quoted = "TO_TIMESTAMP('#{value.strftime('%Y-%m-%d %H:%M:%S')}:#{("%.6f"%value.to_f).split('.')[1]}','YYYY-MM-DD HH24:MI:SS:FF6')"
end
#/sonar