From 03732049eda453fe0853cf50dec644232b5e8f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guitaut?= Date: Wed, 8 Jun 2022 14:53:37 +0200 Subject: [PATCH] DEV: Use nested form for `FreedomPatches` module It seems that not using the nested form for the `FreedomPatches` namespace is breaking stuff in some dev env. --- lib/freedom_patches/mail_disable_starttls.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/freedom_patches/mail_disable_starttls.rb b/lib/freedom_patches/mail_disable_starttls.rb index ccdd9116dd9..45daba893a6 100644 --- a/lib/freedom_patches/mail_disable_starttls.rb +++ b/lib/freedom_patches/mail_disable_starttls.rb @@ -6,16 +6,18 @@ # # This should be fixed in an upcoming release of the Mail gem (probably 2.8), # when this patch is merged: https://github.com/mikel/mail/pull/1435 -module FreedomPatches::MailDisableStarttls - def build_smtp_session - super.tap do |smtp| - unless settings[:enable_starttls_auto] - if smtp.respond_to?(:disable_starttls) - smtp.disable_starttls +module FreedomPatches + module MailDisableStarttls + def build_smtp_session + super.tap do |smtp| + unless settings[:enable_starttls_auto] + if smtp.respond_to?(:disable_starttls) + smtp.disable_starttls + end end end end - end - ::Mail::SMTP.prepend(self) + ::Mail::SMTP.prepend(self) + end end