0
0
Fork 0

Fix Style/GuardClause cop in app/controllers (#28420)

This commit is contained in:
Matt Jankowski 2024-01-25 10:13:41 -05:00 committed by GitHub
parent 3205a654ca
commit 17ea22671d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 27 additions and 33 deletions

View file

@ -3,7 +3,7 @@
module Admin
class ConfirmationsController < BaseController
before_action :set_user
before_action :check_confirmation, only: [:resend]
before_action :redirect_confirmed_user, only: [:resend], if: :user_confirmed?
def create
authorize @user, :confirm?
@ -25,11 +25,13 @@ module Admin
private
def check_confirmation
if @user.confirmed?
flash[:error] = I18n.t('admin.accounts.resend_confirmation.already_confirmed')
redirect_to admin_accounts_path
end
def redirect_confirmed_user
flash[:error] = I18n.t('admin.accounts.resend_confirmation.already_confirmed')
redirect_to admin_accounts_path
end
def user_confirmed?
@user.confirmed?
end
end
end