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:
@@ -26,10 +26,6 @@ class Verification::Email
|
||||
@plain_token, @encrypted_token = Devise.token_generator.generate(User, :email_verification_token)
|
||||
end
|
||||
|
||||
def self.find(user, token)
|
||||
valid_token?(user, token)
|
||||
end
|
||||
|
||||
def self.valid_token?(user, token)
|
||||
Devise.token_generator.digest(User, :email_verification_token, user.email_verification_token) == token
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user