From 0e828afa15e0304a9df14e86ee106613bfc85659 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 26 Jan 2018 13:04:16 +0200 Subject: [PATCH] Improve readability #660 --- app/models/concerns/contact/transferable.rb | 2 +- app/models/contact.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/contact/transferable.rb b/app/models/concerns/contact/transferable.rb index e8c10db06..de5b53210 100644 --- a/app/models/concerns/contact/transferable.rb +++ b/app/models/concerns/contact/transferable.rb @@ -9,8 +9,8 @@ module Concerns::Contact::Transferable def transfer(new_registrar) new_contact = self.dup new_contact.registrar = new_registrar - new_contact.generate_code new_contact.original = self + new_contact.regenerate_code new_contact.regenerate_auth_info new_contact.remove_address unless self.class.address_processing? new_contact.save! diff --git a/app/models/contact.rb b/app/models/contact.rb index 16f3e81a2..b9ed99af4 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -336,6 +336,8 @@ class Contact < ActiveRecord::Base end # rubocop:enable Metrics/CyclomaticComplexity + alias_method :regenerate_code, :generate_code + def country Country.new(country_code) end