mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 16:53:37 +02:00
add contact format only for new records
This commit is contained in:
parent
25eed3e364
commit
d00564f243
1 changed files with 3 additions and 0 deletions
|
@ -111,7 +111,9 @@ class Contact < ActiveRecord::Base
|
|||
self[:code] = code if new_record? # cannot change code later
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/CyclomaticComplexity
|
||||
def prefix_code
|
||||
return nil unless new_record?
|
||||
return nil if registrar.blank?
|
||||
code = self[:code]
|
||||
|
||||
|
@ -126,6 +128,7 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
self[:code] = "#{registrar.code}:#{code}".upcase
|
||||
end
|
||||
# rubocop:enable Metrics/CyclomaticComplexity
|
||||
|
||||
# used only for contact trasphere
|
||||
def generate_new_code!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue