Fix rubocop offenses - Requires Ruby 3.1+

This commit is contained in:
Sebastian Serth
2022-11-25 10:53:14 +01:00
parent bdf474e684
commit 574e99eddd
93 changed files with 315 additions and 315 deletions

View File

@ -115,16 +115,16 @@ class ApplicationController < ActionController::Base
redirect_back fallback_location: :root, allow_other_host: false, alert: message
end
end
format.json { render json: {error: message}, status: status }
format.json { render json: {error: message}, status: }
end
end
private :render_error
def switch_locale(&action)
def switch_locale(&)
session[:locale] = sanitize_locale(params[:custom_locale] || params[:locale] || session[:locale])
locale = session[:locale] || I18n.default_locale
Sentry.set_extras(locale: locale)
I18n.with_locale(locale, &action)
Sentry.set_extras(locale:)
I18n.with_locale(locale, &)
end
private :switch_locale