]> source.dussan.org Git - sonarqube.git/blob
78d7030872b2824b9ad230741748573108ad2b25
[sonarqube.git] /
1 if RUBY_PLATFORM =~ /java/
2   begin
3     tried_gem ||= false
4     require 'active_record/version'
5   rescue LoadError
6     raise if tried_gem
7     require 'rubygems'
8     gem 'activerecord'
9     tried_gem = true
10     retry
11   end
12   if ActiveRecord::VERSION::MAJOR < 2
13     if defined?(RAILS_CONNECTION_ADAPTERS)
14       RAILS_CONNECTION_ADAPTERS << %q(jdbc)
15     else
16       RAILS_CONNECTION_ADAPTERS = %w(jdbc)
17     end
18     if ActiveRecord::VERSION::MAJOR == 1 && ActiveRecord::VERSION::MINOR == 14
19       require 'active_record/connection_adapters/jdbc_adapter'
20     end
21   else
22     require 'active_record'
23     require 'active_record/connection_adapters/jdbc_adapter'
24   end
25 else
26   warn "ActiveRecord-JDBC is for use with JRuby only"
27 end