mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 01:03:35 +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
|
self[:code] = code if new_record? # cannot change code later
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# rubocop:disable Metrics/CyclomaticComplexity
|
||||||
def prefix_code
|
def prefix_code
|
||||||
|
return nil unless new_record?
|
||||||
return nil if registrar.blank?
|
return nil if registrar.blank?
|
||||||
code = self[:code]
|
code = self[:code]
|
||||||
|
|
||||||
|
@ -126,6 +128,7 @@ class Contact < ActiveRecord::Base
|
||||||
|
|
||||||
self[:code] = "#{registrar.code}:#{code}".upcase
|
self[:code] = "#{registrar.code}:#{code}".upcase
|
||||||
end
|
end
|
||||||
|
# rubocop:enable Metrics/CyclomaticComplexity
|
||||||
|
|
||||||
# used only for contact trasphere
|
# used only for contact trasphere
|
||||||
def generate_new_code!
|
def generate_new_code!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue