Introduce kind and reg_no contact's attributes

#266
This commit is contained in:
Artur Beljajev 2016-12-22 16:34:29 +02:00
parent 16ebdc6c90
commit e6069e06a9
3 changed files with 33 additions and 0 deletions

View file

@ -15,6 +15,7 @@ class Contact < ActiveRecord::Base
has_paper_trail class_name: "ContactVersion", meta: { children: :children_log }
attr_accessor :legal_document_id
alias_attribute :kind, :ident_type
accepts_nested_attributes_for :legal_documents
@ -583,4 +584,9 @@ class Contact < ActiveRecord::Base
self[attr_name.to_sym] = nil
end
end
def reg_no
return if priv?
ident
end
end