Create domain works with nested attributes

This commit is contained in:
Martin Lensment 2015-02-16 11:45:27 +02:00
parent 037cb57e00
commit 27d19ad237
4 changed files with 124 additions and 6 deletions

View file

@ -41,6 +41,7 @@ class Domain < ActiveRecord::Base
reject_if: proc { |attrs| attrs[:public_key].blank? }
has_many :legal_documents, as: :documentable
accepts_nested_attributes_for :legal_documents, reject_if: proc { |attrs| attrs[:body].blank? }
delegate :code, to: :owner_contact, prefix: true
delegate :email, to: :owner_contact, prefix: true