From 4419aea1da2a1a5f3ea421f7ab1d4aeb04d1c87b Mon Sep 17 00:00:00 2001 From: rebuilt Date: Wed, 11 Oct 2023 11:15:13 -0700 Subject: [PATCH] fix: make sure sped is taken into account when caching analyze page --- app/presenters/analyze/presenter.rb | 15 +++++++++++++++ app/views/analyze/index.html.erb | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/presenters/analyze/presenter.rb b/app/presenters/analyze/presenter.rb index bcad9d8d..99f31288 100644 --- a/app/presenters/analyze/presenter.rb +++ b/app/presenters/analyze/presenter.rb @@ -181,5 +181,20 @@ module Analyze income_params.split(",").map { |income| Income.find_by_slug(income) }.compact end end + + def cache_objects + [subcategory, + selected_academic_years, + graph, + selected_races, + selected_grades, + grades, + selected_genders, + genders, + selected_ells, + ells, + selected_speds, + speds] + end end end diff --git a/app/views/analyze/index.html.erb b/app/views/analyze/index.html.erb index 84737b19..909cd431 100644 --- a/app/views/analyze/index.html.erb +++ b/app/views/analyze/index.html.erb @@ -13,7 +13,7 @@ <%= render partial: "school_years", locals: {available_academic_years: @presenter.academic_years, selected_academic_years: @presenter.selected_academic_years, district: @district, school: @school, academic_year: @academic_year, category: @presenter.category, subcategory: @presenter.subcategory, measures: @presenter.measures, graph: @presenter.graph} %> <%= render partial: "data_filters", locals: {district: @district, school: @school, academic_year: @academic_year, category: @presenter.category, subcategory: @presenter.subcategory} %> - <% cache [@presenter.subcategory, @school, @presenter.selected_academic_years, @presenter.graph, @presenter.selected_races, @presenter.selected_grades, @presenter.grades, @presenter.selected_genders, @presenter.genders, @presenter.selected_ells, @presenter.ells] do %> + <% cache [@school, @presenter.cache_objects] do %>
<% @presenter.measures.each do |measure| %>