mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 05:26:17 +02:00
Fixed codeclimate issue
This commit is contained in:
parent
d3bca1434c
commit
4094f9c563
1 changed files with 4 additions and 4 deletions
|
@ -25,13 +25,13 @@ class VerifyEmailsJob < ApplicationJob
|
||||||
end
|
end
|
||||||
|
|
||||||
def need_to_verify?(contact)
|
def need_to_verify?(contact)
|
||||||
return true unless contact.validation_events.any?
|
return true if contact.validation_events.empty?
|
||||||
|
|
||||||
last_validation = contact.validation_events.last
|
last_validation = contact.validation_events.last
|
||||||
|
expired_last_validation = last_validation.successful? && last_validation.created_at < validation_expiry_date
|
||||||
|
failed_last_regex_validation = last_validation.failed? && last_validation.event_data['check_level'] == 'regex'
|
||||||
|
|
||||||
return true if last_validation.successful? && last_validation.created_at < validation_expiry_date
|
expired_last_validation || !failed_last_regex_validation
|
||||||
|
|
||||||
last_validation.failed? && last_validation.event_data['check_level'] == 'regex' ? false : true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def logger
|
def logger
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue