mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Add verification methods
This commit is contained in:
parent
cc142076c3
commit
9ae85f3d74
2 changed files with 12 additions and 2 deletions
|
@ -1,4 +1,14 @@
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue