mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Convert database names to ones appropriate for JRuby
This commit is contained in:
parent
f12f756473
commit
4dd2d07d4a
1 changed files with 12 additions and 1 deletions
|
@ -64,8 +64,8 @@ module Rails
|
||||||
|
|
||||||
def initialize(*args)
|
def initialize(*args)
|
||||||
@original_wd = Dir.pwd
|
@original_wd = Dir.pwd
|
||||||
|
|
||||||
super
|
super
|
||||||
|
convert_database_option_for_jruby
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
@ -165,6 +165,17 @@ module Rails
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def convert_database_option_for_jruby
|
||||||
|
if defined?(JRUBY_VERSION)
|
||||||
|
case options[:database]
|
||||||
|
when "oracle" then options[:database].replace "jdbc"
|
||||||
|
when "postgresql" then options[:database].replace "jdbcpostgresql"
|
||||||
|
when "mysql" then options[:database].replace "jdbcmysql"
|
||||||
|
when "sqlite3" then options[:database].replace "jdbcsqlite3"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def ruby_debugger_gemfile_entry
|
def ruby_debugger_gemfile_entry
|
||||||
if RUBY_VERSION < "1.9"
|
if RUBY_VERSION < "1.9"
|
||||||
"gem 'ruby-debug'"
|
"gem 'ruby-debug'"
|
||||||
|
|
Loading…
Reference in a new issue