mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 09:45:11 +02:00
Added missing CID for custom code
This commit is contained in:
parent
6bded6bc80
commit
60d564d098
4 changed files with 29 additions and 20 deletions
|
@ -55,10 +55,11 @@ class Epp::Contact < Contact
|
|||
|
||||
# add prefix when needed
|
||||
if custom_code.present?
|
||||
prefix, custom = custom_code.split(':')
|
||||
if prefix != registrar.code && custom != registrar.code
|
||||
custom_code = "#{registrar.code}:#{custom_code}"
|
||||
cid, rcode, custom = custom_code.split(':')
|
||||
if "#{cid}:#{rcode}" != registrar.contact_prefix
|
||||
custom_code = "#{registrar.contact_prefix}:#{custom_code}"
|
||||
end
|
||||
custom_code = nil if custom_code == registrar.contact_prefix
|
||||
end
|
||||
|
||||
super(
|
||||
|
|
|
@ -140,4 +140,8 @@ class Registrar < ActiveRecord::Base
|
|||
def code=(code)
|
||||
self[:code] = code.gsub(/[ :]/, '').upcase if new_record? && code.present?
|
||||
end
|
||||
|
||||
def contact_prefix
|
||||
"CID:#{code}"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue