111864739-contact_and_domain_create

This commit is contained in:
Stas 2016-02-15 17:52:30 +02:00
parent 59f7f364ad
commit 6ebcaf69d0
5 changed files with 67 additions and 17 deletions

View file

@ -12,6 +12,10 @@ class Contact < ActiveRecord::Base
# TODO: remove later
has_many :depricated_statuses, class_name: 'DepricatedContactStatus', dependent: :destroy
has_paper_trail class_name: "ContactVersion", meta: { children: :children_log }
attr_accessor :legal_document_id
accepts_nested_attributes_for :legal_documents
validates :name, :phone, :email, :ident, :ident_type,
@ -497,8 +501,14 @@ class Contact < ActiveRecord::Base
]).present?
end
def update_related_whois_records
related_domain_descriptions.each{ |x, y| WhoisRecord.find_by(name: x).try(:save) }
end
def update_related_whois_records
related_domain_descriptions.each{ |x, y| WhoisRecord.find_by(name: x).try(:save) }
end
def children_log
log = HashWithIndifferentAccess.new
log[:legal_documents]= [legal_document_id]
log
end
end