Add FD if email belongs to registant

This commit is contained in:
Alex Sherman 2021-03-19 18:19:28 +05:00
parent a3260bb5bf
commit 81c21db392
2 changed files with 20 additions and 1 deletions

View file

@ -6,7 +6,11 @@ module Domains
def execute
domain_contacts = Contact.where(email: email).map(&:domain_contacts).flatten
domains = domain_contacts.map(&:domain).flatten
registrant_ids = Registrant.where(email: email).pluck(:id)
domains = domain_contacts.map(&:domain).flatten +
Domain.where(registrant_id: registrant_ids)
domains.each do |domain|
next if domain.force_delete_scheduled?