mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 16:32:04 +02:00
Typeaheads refactor
This commit is contained in:
parent
d3e3c9e8b0
commit
bfe89c7a09
6 changed files with 38 additions and 19 deletions
|
@ -6,7 +6,7 @@ class DomainContact < ActiveRecord::Base
|
|||
def epp_code_map
|
||||
{
|
||||
'2302' => [
|
||||
[:contact, :taken, {value: {obj: 'contact', val: contact.code}}]
|
||||
[:contact, :taken, { value: { obj: 'contact', val: contact.code } }]
|
||||
]
|
||||
}
|
||||
end
|
||||
|
@ -15,7 +15,7 @@ class DomainContact < ActiveRecord::Base
|
|||
ADMIN = 'admin'
|
||||
TYPES = [TECH, ADMIN]
|
||||
|
||||
# TODO: Fix EPP problems
|
||||
validates :contact, presence: true
|
||||
validates :contact, uniqueness: { scope: [:domain_id, :contact_type] }
|
||||
|
||||
scope :admin, -> { where(contact_type: ADMIN) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue