Story #105846070 - ensure that person search is limited to person contacts to avoid pollution

This commit is contained in:
Matt Farnsworth 2015-12-14 15:01:06 +02:00
parent 342de9a9c9
commit 8f29a2f94a

View file

@ -40,7 +40,10 @@ class BusinessRegistryCache < ActiveRecord::Base
def fetch_associated_domains(ident_code, ident_cc)
cached = fetch_by_ident_and_cc(ident_code, ident_cc)
if cached.blank?
Domain.includes(:registrar, :registrant).where(contacts: {ident: ident_code, ident_country_code: ident_cc})
Domain.includes(:registrar, :registrant).where(contacts: {
ident_type: 'priv',
ident: ident_code,
ident_country_code: ident_cc})
else
cached.associated_domains
end