aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorYoshiyuki Hirano <yhirano@me.com>2017-08-07 20:46:14 +0900
committerYoshiyuki Hirano <yhirano@me.com>2017-08-09 07:18:56 +0900
commit62499cb6e088c3bc32a9396322c7473a17a28640 (patch)
treeb0b9ebcbf8332a237728f5db86d3c03a2fd375d0 /railties/lib
parent220049fb32152aa3e1124f77c3d7ee8d0347a9ed (diff)
downloadrails-62499cb6e088c3bc32a9396322c7473a17a28640.tar.gz
rails-62499cb6e088c3bc32a9396322c7473a17a28640.tar.bz2
rails-62499cb6e088c3bc32a9396322c7473a17a28640.zip
Skip unused components when running in Rails plugin
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/generators/rails/plugin/templates/bin/rails.tt15
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/plugin/templates/bin/rails.tt b/railties/lib/rails/generators/rails/plugin/templates/bin/rails.tt
index ffa277e334..cacded49e8 100644
--- a/railties/lib/rails/generators/rails/plugin/templates/bin/rails.tt
+++ b/railties/lib/rails/generators/rails/plugin/templates/bin/rails.tt
@@ -9,5 +9,20 @@ APP_PATH = File.expand_path('../<%= dummy_path -%>/config/application', __dir__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
+<% if include_all_railties? -%>
require 'rails/all'
+<% else -%>
+require "rails"
+# Pick the frameworks you want:
+require "active_model/railtie"
+require "active_job/railtie"
+<%= comment_if :skip_active_record %>require "active_record/railtie"
+require "action_controller/railtie"
+<%= comment_if :skip_action_mailer %>require "action_mailer/railtie"
+require "action_view/railtie"
+require "active_storage/engine"
+<%= comment_if :skip_action_cable %>require "action_cable/engine"
+<%= comment_if :skip_sprockets %>require "sprockets/railtie"
+<%= comment_if :skip_test %>require "rails/test_unit/railtie"
+<% end -%>
require 'rails/engine/commands'