mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Convert database names to ones appropriate for JRuby
This commit is contained in:
@@ -64,8 +64,8 @@ module Rails
|
||||
|
||||
def initialize(*args)
|
||||
@original_wd = Dir.pwd
|
||||
|
||||
super
|
||||
convert_database_option_for_jruby
|
||||
end
|
||||
|
||||
protected
|
||||
@@ -165,6 +165,17 @@ module Rails
|
||||
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
|
||||
if RUBY_VERSION < "1.9"
|
||||
"gem 'ruby-debug'"
|
||||
|
||||
Reference in New Issue
Block a user