aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2016-08-03 03:36:35 +0900
committerAkira Matsuda <ronnie@dio.jp>2016-08-03 03:36:35 +0900
commit31c1ed95d33bd9a46a6a4ebb5c1e1fa2af171969 (patch)
tree0f159770a04ac03db91531f60d63b20b790a48ce /railties
parent88cdecc050396f4a106c579231a402b0bfc8c644 (diff)
downloadrails-31c1ed95d33bd9a46a6a4ebb5c1e1fa2af171969.tar.gz
rails-31c1ed95d33bd9a46a6a4ebb5c1e1fa2af171969.tar.bz2
rails-31c1ed95d33bd9a46a6a4ebb5c1e1fa2af171969.zip
Show supported DBs first in `rails new --help`
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators/app_base.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 8d4056c202..3e0fedb7d2 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -10,7 +10,7 @@ require 'active_support/core_ext/array/extract_options'
module Rails
module Generators
class AppBase < Base # :nodoc:
- DATABASES = %w( mysql oracle postgresql sqlite3 frontbase ibm_db sqlserver )
+ DATABASES = %w( mysql postgresql sqlite3 oracle frontbase ibm_db sqlserver )
JDBC_DATABASES = %w( jdbcmysql jdbcsqlite3 jdbcpostgresql jdbc )
DATABASES.concat(JDBC_DATABASES)
@@ -266,12 +266,12 @@ module Rails
end
def gem_for_database
- # %w( mysql oracle postgresql sqlite3 frontbase ibm_db sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql )
+ # %w( mysql postgresql sqlite3 oracle frontbase ibm_db sqlserver jdbcmysql jdbcsqlite3 jdbcpostgresql )
case options[:database]
- when "oracle" then ["ruby-oci8", nil]
+ when "mysql" then ["mysql2", [">= 0.3.18", "< 0.5"]]
when "postgresql" then ["pg", ["~> 0.18"]]
+ when "oracle" then ["ruby-oci8", nil]
when "frontbase" then ["ruby-frontbase", nil]
- when "mysql" then ["mysql2", [">= 0.3.18", "< 0.5"]]
when "sqlserver" then ["activerecord-sqlserver-adapter", nil]
when "jdbcmysql" then ["activerecord-jdbcmysql-adapter", nil]
when "jdbcsqlite3" then ["activerecord-jdbcsqlite3-adapter", nil]
@@ -284,9 +284,9 @@ module Rails
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 "oracle" then options[:database].replace "jdbc"
when "sqlite3" then options[:database].replace "jdbcsqlite3"
end
end