Domain form has now domain_contact part

This commit is contained in:
Martin Lensment 2014-09-19 18:17:41 +03:00
parent 4fef7e94c8
commit d3e3c9e8b0
6 changed files with 41 additions and 12 deletions

View file

@ -4,7 +4,8 @@ class Domain < ActiveRecord::Base
belongs_to :registrar
belongs_to :owner_contact, class_name: 'Contact'
has_many :domain_contacts, dependent: :delete_all, autosave: true
has_many :domain_contacts, dependent: :delete_all
accepts_nested_attributes_for :domain_contacts, allow_destroy: true
has_many :tech_contacts, -> do
where(domain_contacts: { contact_type: DomainContact::TECH })