mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
14 lines
331 B
Ruby
14 lines
331 B
Ruby
class EmailAddressVerification < ApplicationRecord
|
|
|
|
RECENTLY_VERIFIED_PERIOD = 1.month
|
|
|
|
def recently_verified?
|
|
verified_at > Time.zone.now - RECENTLY_VERIFIED_PERIOD
|
|
end
|
|
|
|
def verify
|
|
validation_request = Truemail.validate(email)
|
|
|
|
update(verified_at: Time.zone.now) if validation_request.result.success
|
|
end
|
|
end
|