mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
parent
0ac3a43613
commit
8c915164c5
8 changed files with 51 additions and 38 deletions
|
@ -1,9 +1,9 @@
|
|||
class TechDomainContact < DomainContact
|
||||
# Audit log is needed, therefore no raw SQL
|
||||
def self.replace(predecessor, successor)
|
||||
def self.replace(current_contact, new_contact)
|
||||
affected_domains = []
|
||||
skipped_domains = []
|
||||
tech_contacts = where(contact: predecessor)
|
||||
tech_contacts = where(contact: current_contact)
|
||||
|
||||
transaction do
|
||||
tech_contacts.each do |tech_contact|
|
||||
|
@ -12,7 +12,7 @@ class TechDomainContact < DomainContact
|
|||
next
|
||||
end
|
||||
|
||||
tech_contact.contact = successor
|
||||
tech_contact.contact = new_contact
|
||||
tech_contact.save!
|
||||
affected_domains << tech_contact.domain.name
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue