diff --git a/app/models/case_court_report_context.rb b/app/models/case_court_report_context.rb index 2868cd4557..122ccabb23 100644 --- a/app/models/case_court_report_context.rb +++ b/app/models/case_court_report_context.rb @@ -57,8 +57,8 @@ def case_orders(orders) end def filtered_interviewees - # this query is slow - CaseContactContactType.includes(:case_contact, :contact_type) + CaseContactContactType + .joins(:contact_type, case_contact: :casa_case) .where("case_contacts.casa_case_id": @casa_case.id) .where("case_contacts.occurred_at": @date_range) end