mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 09:45:11 +02:00
Merge branch '105842700-registrants_portal' into staging
This commit is contained in:
commit
af5b67a07a
3 changed files with 21 additions and 9 deletions
|
@ -22,11 +22,16 @@ class BusinessRegistryCache < ActiveRecord::Base
|
|||
|
||||
# 1. load domains by business
|
||||
# 2. load domains by person
|
||||
def associated_contacts
|
||||
contact_ids = Contact.where(ident_type: 'org', ident: associated_businesses, ident_country_code: 'EE').pluck(:id)
|
||||
contact_ids += Contact.where(ident_type: 'priv', ident: ident, ident_country_code: ident_country_code).pluck(:id)
|
||||
contact_ids
|
||||
end
|
||||
|
||||
def associated_domains
|
||||
domains = []
|
||||
|
||||
contact_ids = Contact.where(ident_type: 'org', ident: associated_businesses, ident_country_code: 'EE').pluck(:id)
|
||||
contact_ids += Contact.where(ident_type: 'priv', ident: ident, ident_country_code: ident_country_code).pluck(:id)
|
||||
contact_ids = associated_contacts
|
||||
|
||||
unless contact_ids.blank?
|
||||
domains = DomainContact.distinct.where(contact_id: contact_ids).pluck(:domain_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue