mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 16:53:37 +02:00
Improve readability
This commit is contained in:
parent
fed0119535
commit
404932316d
1 changed files with 6 additions and 6 deletions
|
@ -40,17 +40,17 @@ module Concerns::Domain::Transferable
|
||||||
|
|
||||||
def transfer_domain_contacts(new_registrar)
|
def transfer_domain_contacts(new_registrar)
|
||||||
copied_ids = []
|
copied_ids = []
|
||||||
contacts.each do |c|
|
contacts.each do |contact|
|
||||||
next if copied_ids.include?(c.id) || c.registrar == new_registrar
|
next if copied_ids.include?(contact.id) || contact.registrar == new_registrar
|
||||||
|
|
||||||
if registrant_id_was == c.id # registrant was copied previously, do not copy it again
|
if registrant_id_was == contact.id # registrant was copied previously, do not copy it again
|
||||||
oc = OpenStruct.new(id: registrant_id)
|
oc = OpenStruct.new(id: registrant_id)
|
||||||
else
|
else
|
||||||
oc = c.transfer(new_registrar)
|
oc = contact.transfer(new_registrar)
|
||||||
end
|
end
|
||||||
|
|
||||||
domain_contacts.where(contact_id: c.id).update_all({ contact_id: oc.id }) # n+1 workaround
|
domain_contacts.where(contact_id: contact.id).update_all({ contact_id: oc.id }) # n+1 workaround
|
||||||
copied_ids << c.id
|
copied_ids << contact.id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue