From b786d386f1d1015cbb65db4fe38e6df2ba5d36aa Mon Sep 17 00:00:00 2001 From: drummer83 Date: Tue, 30 Jan 2024 22:57:19 +0100 Subject: [PATCH] Simplify producer mailer The method is used only once and therefore not required --- app/mailers/producer_mailer.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/mailers/producer_mailer.rb b/app/mailers/producer_mailer.rb index 5d6290794c..e1ebf83cc1 100644 --- a/app/mailers/producer_mailer.rb +++ b/app/mailers/producer_mailer.rb @@ -9,7 +9,7 @@ class ProducerMailer < ApplicationMailer load_data - I18n.with_locale(owner_locale) do + I18n.with_locale valid_locale(@producer.owner) do return unless orders?(order_cycle, producer) mail( @@ -23,10 +23,6 @@ class ProducerMailer < ApplicationMailer private - def owner_locale - valid_locale(@producer.owner) - end - def load_data @coordinator = @order_cycle.coordinator