Use Verification::Email.valid_token? instead of .find
This way it's more obvious that the method is supposed to return a boolean. When upgrading rubocop, we get a `Naming/PredicateMethod` error due to `.find` returning a boolean.
This commit is contained in:
@@ -5,7 +5,7 @@ class Verification::EmailController < ApplicationController
|
||||
skip_authorization_check
|
||||
|
||||
def show
|
||||
if Verification::Email.find(current_user, params[:email_verification_token])
|
||||
if Verification::Email.valid_token?(current_user, params[:email_verification_token])
|
||||
current_user.update!(verified_at: Time.current)
|
||||
redirect_to account_path, notice: t("verification.email.show.flash.success")
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user