mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 22:54:47 +02:00
22 lines
778 B
Ruby
22 lines
778 B
Ruby
class FillEmailVerifications < ActiveRecord::Migration[6.0]
|
|
include Concerns::EmailVerifable
|
|
|
|
def up
|
|
# registrar_billing_emails = Registrar.pluck(:billing_email).uniq.reject(&:blank?)
|
|
# registrar_emails = Registrar.pluck(:email).uniq.reject(&:blank?)
|
|
# contact_emails = Contact.pluck(:email).uniq.reject(&:blank?)
|
|
#
|
|
# emails = (contact_emails + registrar_emails + registrar_billing_emails)
|
|
# emails = emails.map{ |email| punycode_to_unicode(email) }.uniq
|
|
#
|
|
# result = emails.map do |email|
|
|
# { email: email, domain: domain(email) }
|
|
# end
|
|
# EmailAddressVerification.import result, batch_size: 500 #deprecated/removed
|
|
# need to use insert_all if uncommented
|
|
end
|
|
|
|
def down
|
|
EmailAddressVerification.delete_all
|
|
end
|
|
end
|