mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
Fix CC issues
This commit is contained in:
parent
a13725faa7
commit
3d444c3a04
5 changed files with 27 additions and 14 deletions
|
@ -7,7 +7,7 @@ class FillEmailVerifications < ActiveRecord::Migration[6.0]
|
|||
emails = (contact_emails || registrar_emails || registrar_billing_emails).uniq
|
||||
|
||||
result = emails.map do |email|
|
||||
{ email: email, domain: Mail::Address.new(email).domain || 'not_found' }
|
||||
{ email: email, domain: domain(email) }
|
||||
end
|
||||
|
||||
EmailAddressVerification.import result, batch_size: 500
|
||||
|
@ -16,4 +16,10 @@ class FillEmailVerifications < ActiveRecord::Migration[6.0]
|
|||
def down
|
||||
EmailAddressVerification.delete_all
|
||||
end
|
||||
|
||||
def domain(email)
|
||||
Mail::Address.new(email).domain || 'not_found'
|
||||
rescue Mail::Field::IncompleteParseError
|
||||
'not_found'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue