From af1244654cd68672a00b7eb14320fd0594905bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 18 Sep 2021 03:12:59 +0200 Subject: [PATCH] Use MailDeliveryJob to send mail in the background The default delivery job class in Rails 5.2 (ActionMailer::DeliveryJob) is deprecated. This option wasn't already enabled in order to ease the upgrade, since after upgrading with Rails 6 `MailDeliveryJob`, it won't be possible to downgrade to Rails 5.2 without risking some crashes in background jobs. --- config/initializers/new_framework_defaults_6_0.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/new_framework_defaults_6_0.rb b/config/initializers/new_framework_defaults_6_0.rb index f8cfdd436..2d66e49a2 100644 --- a/config/initializers/new_framework_defaults_6_0.rb +++ b/config/initializers/new_framework_defaults_6_0.rb @@ -37,7 +37,7 @@ Rails.application.config.active_storage.replace_on_assign_to_many = true # If you send mail in the background, job workers need to have a copy of # MailDeliveryJob to ensure all delivery jobs are processed properly. # Make sure your entire app is migrated and stable on 6.0 before using this setting. -# Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob" +Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob" # Enable the same cache key to be reused when the object being cached of type # `ActiveRecord::Relation` changes by moving the volatile information (max updated at and count)