Made contact accept address as nested attribute

This commit is contained in:
Andres Keskküla 2014-08-05 16:55:42 +03:00
parent 27ca5714cd
commit 1349abbbc7
3 changed files with 20 additions and 30 deletions

View file

@ -9,6 +9,8 @@ class Contact < ActiveRecord::Base
belongs_to :created_by, class_name: 'EppUser', foreign_key: :created_by_id
belongs_to :updated_by, class_name: 'EppUser', foreign_key: :updated_by_id
accepts_nested_attributes_for :address
validates_presence_of :code, :name, :phone, :email, :ident
validate :ident_must_be_valid