From ebcf9d76764106620a9d59dd7672f6c5418e3778 Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Fri, 6 Jan 2023 10:01:14 +0100 Subject: [PATCH] obey the dog --- app/controllers/application_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b794daaa..718f760e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -11,8 +11,8 @@ class ApplicationController < ActionController::Base before_action :find_active_announcements # check if user wants to read - def switch_locale(&action) - return I18n.with_locale("en", &action) if Rails.env.test? + def switch_locale(&) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity + return I18n.with_locale("en", &) if Rails.env.test? locale = params[:lang] || current_user&.locale || cookies[:lang] || "en" if params[:lang] && current_user.present? @@ -22,7 +22,7 @@ class ApplicationController < ActionController::Base cookies[:lang] = locale - I18n.with_locale(locale, &action) + I18n.with_locale(locale, &) end # check if user got hit by the banhammer of doom