diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-08-14 18:11:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-14 18:11:46 -0400 |
commit | bef68862ae14244fb93e0abb4c16d06eec535c2d (patch) | |
tree | 4b6bf0b5397a4d602b023928ce89bad3811f8c3d /railties/lib/rails/generators | |
parent | ccd973366bf2c9a103f28ade0862426d74951c87 (diff) | |
parent | 6df78be9bb7035ec73837e9be41781e563da2ab4 (diff) | |
download | rails-bef68862ae14244fb93e0abb4c16d06eec535c2d.tar.gz rails-bef68862ae14244fb93e0abb4c16d06eec535c2d.tar.bz2 rails-bef68862ae14244fb93e0abb4c16d06eec535c2d.zip |
Merge pull request #30219 from yhirano55/fix_app_generator_api_options
Refactor `--api` option of the app generator
Diffstat (limited to 'railties/lib/rails/generators')
5 files changed, 7 insertions, 7 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt b/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt index 185c0017f1..938eff8ed0 100644 --- a/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/app/controllers/application_controller.rb.tt @@ -1,2 +1,2 @@ -class ApplicationController < ActionController::<%= options[:api] ? "API" : "Base" %> +class ApplicationController < ActionController::<%= options.api? ? "API" : "Base" %> end diff --git a/railties/lib/rails/generators/rails/app/templates/bin/setup.tt b/railties/lib/rails/generators/rails/app/templates/bin/setup.tt index a53d1fb0a9..233b5a1d95 100644 --- a/railties/lib/rails/generators/rails/app/templates/bin/setup.tt +++ b/railties/lib/rails/generators/rails/app/templates/bin/setup.tt @@ -15,12 +15,12 @@ chdir APP_ROOT do puts '== Installing dependencies ==' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') -<% unless options[:skip_yarn] -%> +<% unless options.skip_yarn? -%> # Install JavaScript dependencies if using Yarn # system('bin/yarn') <% end -%> -<% unless options.skip_active_record -%> +<% unless options.skip_active_record? -%> # puts "\n== Copying sample files ==" # unless File.exist?('config/database.yml') diff --git a/railties/lib/rails/generators/rails/app/templates/bin/update.tt b/railties/lib/rails/generators/rails/app/templates/bin/update.tt index 5b6e50883e..d744bec32f 100644 --- a/railties/lib/rails/generators/rails/app/templates/bin/update.tt +++ b/railties/lib/rails/generators/rails/app/templates/bin/update.tt @@ -15,7 +15,7 @@ chdir APP_ROOT do puts '== Installing dependencies ==' system! 'gem install bundler --conservative' system('bundle check') || system!('bundle install') -<% unless options.skip_active_record -%> +<% unless options.skip_active_record? -%> puts "\n== Updating database ==" system! 'bin/rails db:migrate' diff --git a/railties/lib/rails/generators/rails/app/templates/config/application.rb b/railties/lib/rails/generators/rails/app/templates/config/application.rb index e9edad5309..eec973caa5 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/application.rb +++ b/railties/lib/rails/generators/rails/app/templates/config/application.rb @@ -31,7 +31,7 @@ module <%= app_const_base %> # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. -<%- if options[:api] -%> +<%- if options.api? -%> # Only loads a smaller set of middleware suitable for API only apps. # Middleware like session, flash, cookies can be added back manually. diff --git a/railties/lib/rails/generators/rails/app/templates/gitignore b/railties/lib/rails/generators/rails/app/templates/gitignore index 64ed09dc4b..d8eeb1772d 100644 --- a/railties/lib/rails/generators/rails/app/templates/gitignore +++ b/railties/lib/rails/generators/rails/app/templates/gitignore @@ -24,13 +24,13 @@ # Ignore uploaded files in development /storage/* -<% unless options[:skip_yarn] -%> +<% unless options.skip_yarn? -%> /node_modules /yarn-error.log <% end -%> -<% unless options[:api] -%> +<% unless options.api? -%> /public/assets <% end -%> .byebug_history |