mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Add epp attr map
This commit is contained in:
parent
3256534f0d
commit
ec9dcf52cf
4 changed files with 8 additions and 4 deletions
|
@ -26,7 +26,7 @@ module EppErrors
|
|||
else
|
||||
next unless code = find_epp_code(err)
|
||||
err = {code: code, msg: err}
|
||||
err[:value] = {val: send(key), obj: self.class::EPP_OBJ} unless self.class.reflect_on_association(key)
|
||||
err[:value] = {val: send(key), obj: self.class::EPP_ATTR_MAP[key]} unless self.class.reflect_on_association(key)
|
||||
epp_errors << err
|
||||
end
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@ class Contact < ActiveRecord::Base
|
|||
'2005' => ['Phone nr is invalid', 'Email is invalid']
|
||||
}
|
||||
|
||||
EPP_OBJ = 'contact'
|
||||
EPP_ATTR_MAP = {}
|
||||
|
||||
has_one :address
|
||||
has_many :domain_contacts
|
||||
|
|
|
@ -11,7 +11,9 @@ class Domain < ActiveRecord::Base
|
|||
'2303' => ['Contact was not found'] # Object does not exist
|
||||
}
|
||||
|
||||
EPP_OBJ = 'domain'
|
||||
EPP_ATTR_MAP = {
|
||||
owner_contact: 'registrant'
|
||||
}
|
||||
|
||||
belongs_to :registrar
|
||||
belongs_to :owner_contact, class_name: 'Contact'
|
||||
|
|
|
@ -5,7 +5,9 @@ class Nameserver < ActiveRecord::Base
|
|||
'2005' => ['Hostname is invalid', 'IP is invalid']
|
||||
}
|
||||
|
||||
EPP_OBJ = 'ns'
|
||||
EPP_ATTR_MAP = {
|
||||
hostname: 'hostName'
|
||||
}
|
||||
|
||||
belongs_to :registrar
|
||||
has_and_belongs_to_many :domains
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue