aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-04-18 14:40:13 +0200
committersimonbrandhof <simon.brandhof@gmail.com>2011-04-18 14:40:13 +0200
commit07983847c9fd81f9f471cf3ad78e5748a43ee031 (patch)
tree7b9069f0297355f7a9f8a4f9b9fdd4cae00773f6 /sonar-server
parentbaff8c8426587f98688afa1ab5df4f3d4afae2b8 (diff)
downloadsonarqube-07983847c9fd81f9f471cf3ad78e5748a43ee031.tar.gz
sonarqube-07983847c9fd81f9f471cf3ad78e5748a43ee031.zip
Fix loading of db dialect in ruby on rails
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/config/environment.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/config/environment.rb b/sonar-server/src/main/webapp/WEB-INF/config/environment.rb
index 721bd127307..2ce9d7254ca 100644
--- a/sonar-server/src/main/webapp/WEB-INF/config/environment.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/config/environment.rb
@@ -62,11 +62,11 @@ module ActiveRecord
@config[:connection_alive_sql] ||= ::Java::OrgSonarServerUi::JRubyFacade.getInstance().getConfigurationValue('sonar.jdbc.validationQuery')
@jndi_connection = true # used in JndiConnectionPoolCallbacks to close this initial connection
-
+
@connection_factory = JdbcConnectionFactory.impl do
::Java::OrgSonarServerUi::JRubyFacade.getInstance().getConnection()
end
- @config[:driver] = ::Java::OrgSonarServerUi::JRubyFacade.getInstance().getConfigurationValue('sonar.jdbc.driverClassName')
+ @config[:dialect] = ::Java::OrgSonarServerUi::JRubyFacade.getInstance().getDialect().getActiveRecordDialectCode()
connection # force the connection to load
set_native_database_types
@@ -81,7 +81,7 @@ end
class ActiveRecord::Migration
def self.alter_to_big_primary_key(tablename)
- dialect = ActiveRecord::Base.configurations[ ENV['RAILS_ENV'] ]["dialect"]
+ dialect = ::Java::OrgSonarServerUi::JRubyFacade.getInstance().getDialect().getActiveRecordDialectCode()
case dialect
when "postgre"
execute "ALTER TABLE #{tablename} ALTER COLUMN id TYPE bigint"