Improve readability

#660
This commit is contained in:
Artur Beljajev 2018-01-26 13:04:16 +02:00
parent 76782c72e3
commit 0e828afa15
2 changed files with 3 additions and 1 deletions

View file

@ -9,8 +9,8 @@ module Concerns::Contact::Transferable
def transfer(new_registrar) def transfer(new_registrar)
new_contact = self.dup new_contact = self.dup
new_contact.registrar = new_registrar new_contact.registrar = new_registrar
new_contact.generate_code
new_contact.original = self new_contact.original = self
new_contact.regenerate_code
new_contact.regenerate_auth_info new_contact.regenerate_auth_info
new_contact.remove_address unless self.class.address_processing? new_contact.remove_address unless self.class.address_processing?
new_contact.save! new_contact.save!

View file

@ -336,6 +336,8 @@ class Contact < ActiveRecord::Base
end end
# rubocop:enable Metrics/CyclomaticComplexity # rubocop:enable Metrics/CyclomaticComplexity
alias_method :regenerate_code, :generate_code
def country def country
Country.new(country_code) Country.new(country_code)
end end