mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 11:38:30 +02:00
Contact change notification email content update #2558
This commit is contained in:
parent
941538b924
commit
410914e16e
4 changed files with 53 additions and 11 deletions
|
@ -7,6 +7,7 @@ class Contact < ActiveRecord::Base
|
|||
has_many :domains, through: :domain_contacts
|
||||
has_many :statuses, class_name: 'ContactStatus', dependent: :destroy
|
||||
has_many :legal_documents, as: :documentable
|
||||
has_many :registrant_domains, class_name: 'Domain', foreign_key: 'registrant_id' # when contant is registrant
|
||||
|
||||
accepts_nested_attributes_for :legal_documents
|
||||
|
||||
|
@ -184,4 +185,21 @@ class Contact < ActiveRecord::Base
|
|||
errors.add(:ident, :invalid_country_code)
|
||||
end
|
||||
end
|
||||
|
||||
def related_domain_descriptions
|
||||
@desc = {}
|
||||
|
||||
registrant_domains.each do |dom|
|
||||
@desc[dom.name] ||= []
|
||||
@desc[dom.name] << :registrant
|
||||
end
|
||||
|
||||
domain_contacts.each do |dc|
|
||||
@desc[dc.domain.name] ||= []
|
||||
@desc[dc.domain.name] << dc.name.downcase.to_sym
|
||||
@desc[dc.domain.name] = @desc[dc.domain.name].compact
|
||||
end
|
||||
|
||||
@desc
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue