mirror of
https://github.com/internetee/registry.git
synced 2025-07-26 04:28:27 +02:00
Generate contact code manually
Generate contact's code explicitly on contact:create epp request and domain transfer. Remove callback.
This commit is contained in:
parent
cefd310cc0
commit
183c2bb82c
4 changed files with 18 additions and 21 deletions
|
@ -45,7 +45,6 @@ class Contact < ActiveRecord::Base
|
|||
end
|
||||
|
||||
before_validation :to_upcase_country_code
|
||||
before_validation :prefix_code
|
||||
before_validation :strip_email
|
||||
before_create :generate_auth_info
|
||||
|
||||
|
@ -366,7 +365,7 @@ class Contact < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# rubocop:disable Metrics/CyclomaticComplexity
|
||||
def prefix_code
|
||||
def generate_code
|
||||
return nil unless new_record?
|
||||
return nil if registrar.blank?
|
||||
code = self[:code]
|
||||
|
|
|
@ -646,7 +646,7 @@ class Epp::Domain < Domain
|
|||
oc.code = nil
|
||||
oc.registrar_id = registrar_id
|
||||
oc.copy_from_id = c.id
|
||||
oc.prefix_code
|
||||
oc.generate_code
|
||||
oc.domain_transfer = true
|
||||
oc.save!(validate: false)
|
||||
oc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue