From f0e1b12c101e0dd0ddaaef8bdcc166624dba62d5 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 19 Feb 2023 21:18:08 -0500 Subject: [PATCH] Autofix Rubocop Style/ExplicitBlockArgument (#23704) --- .rubocop_todo.yml | 6 ------ app/mailers/application_mailer.rb | 6 ++---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 308e0e69e2..c452d1bd2c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -2323,12 +2323,6 @@ Style/ConcatArrayLiterals: Style/Documentation: Enabled: false -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/ExplicitBlockArgument: - Exclude: - - 'app/mailers/application_mailer.rb' - # Offense count: 10 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowedVars. diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index a37682eca6..73b623576c 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -9,9 +9,7 @@ class ApplicationMailer < ActionMailer::Base protected - def locale_for_account(account) - I18n.with_locale(account.user_locale || I18n.default_locale) do - yield - end + def locale_for_account(account, &block) + I18n.with_locale(account.user_locale || I18n.default_locale, &block) end end