mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +02:00
Attach typeahead fields directly to domain
This commit is contained in:
parent
df5f987551
commit
8ea865f1b2
3 changed files with 17 additions and 4 deletions
|
@ -45,6 +45,9 @@ class Domain < ActiveRecord::Base
|
|||
validate :validate_admin_contacts_uniqueness, if: :new_record?
|
||||
validate :validate_domain_statuses_uniqueness, if: :new_record?
|
||||
|
||||
attr_accessor :owner_contact_typeahead
|
||||
attr_accessor :registrar_typeahead
|
||||
|
||||
def name=(value)
|
||||
value.strip!
|
||||
write_attribute(:name, SimpleIDN.to_unicode(value))
|
||||
|
@ -52,6 +55,14 @@ class Domain < ActiveRecord::Base
|
|||
write_attribute(:name_dirty, value)
|
||||
end
|
||||
|
||||
def owner_contact_typeahead
|
||||
@owner_contact_typeahead || owner_contact.try(:name) || nil
|
||||
end
|
||||
|
||||
def registrar_typeahead
|
||||
@registrar_typeahead || registrar || nil
|
||||
end
|
||||
|
||||
def pending_transfer
|
||||
domain_transfers.find_by(status: DomainTransfer::PENDING)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue