From a787333b048199abf006f010633908786496e795 Mon Sep 17 00:00:00 2001 From: Petrik Date: Tue, 25 Jun 2024 15:25:09 +0200 Subject: [PATCH] Document `action_mailer.perform_caching` in environment files. This setting is set to false in all enviroments, but it's a bit unclear why this needs to be set. --- .../rails/app/templates/config/environments/development.rb.tt | 2 ++ .../rails/app/templates/config/environments/production.rb.tt | 4 +++- .../rails/app/templates/config/environments/test.rb.tt | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt index d86d3c8d8f..7bf7e5431a 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt @@ -42,6 +42,8 @@ Rails.application.configure do # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = false + # Disable caching for Action Mailer templates even if Action Controller + # caching is enabled. config.action_mailer.perform_caching = false config.action_mailer.default_url_options = { host: "localhost", port: 3000 } 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 ca79fb1df0..5be7abbaa5 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 @@ -58,7 +58,7 @@ Rails.application.configure do # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true - + # Skip http-to-https redirect for the default health check endpoint. # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } } @@ -85,6 +85,8 @@ Rails.application.configure do <%- end -%> <%- unless options.skip_action_mailer? -%> + # Disable caching for Action Mailer templates even if Action Controller + # caching is enabled. config.action_mailer.perform_caching = false # Ignore bad email addresses and do not raise email delivery errors. diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt index 539ab3e2c2..ddbe3b270b 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt @@ -37,6 +37,8 @@ Rails.application.configure do <%- end -%> <%- unless options.skip_action_mailer? -%> + # Disable caching for Action Mailer templates even if Action Controller + # caching is enabled. config.action_mailer.perform_caching = false # Tell Action Mailer not to deliver emails to the real world.