mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
perf: include survey items with measures to avoid n+1 queries when scoring by student/teacher survey items
This commit is contained in:
parent
330b1c74b1
commit
05f535ed5c
1 changed files with 3 additions and 3 deletions
|
|
@ -8,9 +8,9 @@ class OverviewController < SqmApplicationController
|
|||
@variance_chart_row_presenters = measures.map(&method(:presenter_for_measure))
|
||||
@category_presenters = Category.sorted.map { |category| CategoryPresenter.new(category:) }
|
||||
@student_response_rate_presenter = ResponseRatePresenter.new(focus: :student, school: @school,
|
||||
academic_year: @academic_year)
|
||||
academic_year: @academic_year)
|
||||
@teacher_response_rate_presenter = ResponseRatePresenter.new(focus: :teacher, school: @school,
|
||||
academic_year: @academic_year)
|
||||
academic_year: @academic_year)
|
||||
end
|
||||
|
||||
private
|
||||
|
|
@ -29,7 +29,7 @@ class OverviewController < SqmApplicationController
|
|||
end
|
||||
|
||||
def measures
|
||||
@measures ||= Measure.all.includes(%i[scales admin_data_items category subcategory])
|
||||
@measures ||= Measure.all.includes(%i[scales admin_data_items category subcategory survey_items])
|
||||
end
|
||||
|
||||
def subcategories
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue