mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Add semantic test fixes & maybe solution for an issue
This commit is contained in:
parent
541c2d769a
commit
21fc5edb44
2 changed files with 12 additions and 11 deletions
|
@ -59,7 +59,7 @@ module Concerns::Domain::Transferable
|
|||
copied_ids = []
|
||||
domain_contacts.each do |dc|
|
||||
contact = Contact.find(dc.contact_id)
|
||||
next if copied_ids.include?(contact.id) || contact.registrar == new_registrar
|
||||
next if copied_ids.include?(uniq_contact_hash(dc)) || contact.registrar == new_registrar
|
||||
|
||||
if registrant_id_was == contact.id # registrant was copied previously, do not copy it again
|
||||
oc = OpenStruct.new(id: registrant_id)
|
||||
|
@ -72,7 +72,11 @@ module Concerns::Domain::Transferable
|
|||
else
|
||||
dc.update(contact_id: oc.id)
|
||||
end
|
||||
copied_ids << contact.id
|
||||
copied_ids << uniq_contact_hash(dc)
|
||||
end
|
||||
end
|
||||
|
||||
def uniq_contact_hash(contact)
|
||||
Digest::SHA1.hexdigest(contact.contact_id.to_s + contact.type)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue