Domain form contacts partial refactor

This commit is contained in:
Martin Lensment 2014-09-22 11:06:07 +03:00
parent bfe89c7a09
commit 89295f5642
6 changed files with 17 additions and 14 deletions

View file

@ -3,6 +3,8 @@ class DomainContact < ActiveRecord::Base
belongs_to :contact
belongs_to :domain
attr_accessor :typeahead_value
def epp_code_map
{
'2302' => [
@ -28,4 +30,8 @@ class DomainContact < ActiveRecord::Base
def tech?
contact_type == TECH
end
def typeahead_value
@typeahead_value || contact.try(:name) || nil
end
end