From 8f29a2f94ae450231f2fb9aef1789cd5b8535d86 Mon Sep 17 00:00:00 2001 From: Matt Farnsworth Date: Mon, 14 Dec 2015 15:01:06 +0200 Subject: [PATCH] Story #105846070 - ensure that person search is limited to person contacts to avoid pollution --- app/models/business_registry_cache.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/business_registry_cache.rb b/app/models/business_registry_cache.rb index 18555b1a5..6bd509101 100644 --- a/app/models/business_registry_cache.rb +++ b/app/models/business_registry_cache.rb @@ -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