refactors triplicated code

This commit is contained in:
Juanjo Bazán
2016-04-08 12:16:09 +02:00
parent 473cca418d
commit 991b189610
4 changed files with 19 additions and 27 deletions

View File

@@ -1,19 +1,13 @@
class Management::AccountController < Management::BaseController
before_action :check_verified_user
before_action :only_verified_users
def show
end
private
def check_verified_user
unless current_user.level_two_or_three_verified?
redirect_to management_document_verifications_path, alert: t("management.account.alert.unverified_user")
end
end
def current_user
managed_user
def only_verified_users
check_verified_user t("management.account.alert.unverified_user")
end
end