mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 11:38:30 +02:00
Add verification model & migration
This commit is contained in:
parent
b8ade7628d
commit
cc142076c3
4 changed files with 168 additions and 7 deletions
|
@ -2,6 +2,18 @@ module Concerns
|
|||
module EmailCheckable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def email_verification
|
||||
EmailAddressVerification.find_by(email: self.email)
|
||||
end
|
||||
|
||||
def billing_email_verification
|
||||
if self.attribute_names.include?('billing_email')
|
||||
EmailAddressVerification.find_by(email: self.billing_email)
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
def verify_email_mx_smtp(field:, email:)
|
||||
errors.add(field, :invalid) unless email.blank? || Truemail.valid?(email)
|
||||
end
|
||||
|
|
4
app/models/email_address_verification.rb
Normal file
4
app/models/email_address_verification.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
class EmailAddressVerification < ApplicationRecord
|
||||
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue