diff --git a/app/services/locations/finder.rb b/app/services/locations/finder.rb index 23323afb6..83ea15c2e 100644 --- a/app/services/locations/finder.rb +++ b/app/services/locations/finder.rb @@ -58,6 +58,8 @@ def apply_nomis_agency_filters(scope) end def apply_supplier_filters(scope) + scope = scope.includes(:suppliers) + return scope unless filter_params.key?(:supplier_id) scope = scope.includes(:suppliers).where(suppliers: { id: split_params(:supplier_id) })