diff options
-rw-r--r-- | railties/lib/rails/generators/rails/app/app_generator.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config.ru.tt (renamed from railties/lib/rails/generators/rails/app/templates/config.ru) | 4 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index d62a2e48eb..2a3f16c02e 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -57,7 +57,7 @@ module Rails directory 'app' keep_file 'app/assets/images' - keep_file 'app/assets/javascripts/channels' + keep_file 'app/assets/javascripts/channels' unless options[:skip_action_cable] keep_file 'app/mailers' @@ -84,7 +84,7 @@ module Rails directory "environments" directory "initializers" directory "locales" - directory "redis" + directory "redis" unless options[:skip_action_cable] end end diff --git a/railties/lib/rails/generators/rails/app/templates/config.ru b/railties/lib/rails/generators/rails/app/templates/config.ru.tt index 849b5a1b88..4dddf0c03e 100644 --- a/railties/lib/rails/generators/rails/app/templates/config.ru +++ b/railties/lib/rails/generators/rails/app/templates/config.ru.tt @@ -1,8 +1,10 @@ # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) -Rails.application.eager_load! +<%- unless options[:skip_action_cable] -%> +Rails.application.eager_load! require 'action_cable/process/logging' +<%- end -%> run Rails.application diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt index 945e890e5f..ab99030550 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt @@ -40,8 +40,10 @@ Rails.application.configure do # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + <%- unless options[:skip_action_cable] -%> # Action Cable should be mounted in a separate process for most production setups # config.action_cable.url = 'wss://example.com/cable' + <%- end -%> # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true |