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:
Javi Martín
2025-10-31 14:56:57 +01:00
parent 520f0c42d4
commit 2fdfefe55d
2 changed files with 1 additions and 5 deletions

View File

@@ -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