Change naming

#662
This commit is contained in:
Artur Beljajev 2018-06-04 02:14:15 +03:00
parent 0ac3a43613
commit 8c915164c5
8 changed files with 51 additions and 38 deletions

View file

@ -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