From 993fafcc0e9b0ca3f2e8718d39e9f0f717cea0e6 Mon Sep 17 00:00:00 2001 From: Nelson Jovel Date: Tue, 26 Mar 2024 15:32:34 -0700 Subject: [PATCH] Revert "fix: Makes visible the graphs by grade" This reverts commit 455f716b6d7105263058ef9c12d7fc75d4111ad8. --- app/presenters/analyze/graph/students_by_grade.rb | 7 ++++--- app/presenters/analyze/presenter.rb | 2 +- spec/presenters/analyze/presenter_spec.rb | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/presenters/analyze/graph/students_by_grade.rb b/app/presenters/analyze/graph/students_by_grade.rb index d079bce6..c39126f8 100644 --- a/app/presenters/analyze/graph/students_by_grade.rb +++ b/app/presenters/analyze/graph/students_by_grade.rb @@ -6,9 +6,9 @@ module Analyze include Analyze::Graph::Column::Grade attr_reader :grades - # def initialize(grades:) - # @grades = grades - # end + def initialize(grades:) + @grades = grades + end def to_s "Students by Grade" @@ -52,3 +52,4 @@ module Analyze end end end + diff --git a/app/presenters/analyze/presenter.rb b/app/presenters/analyze/presenter.rb index 5ac08a02..57c5169f 100644 --- a/app/presenters/analyze/presenter.rb +++ b/app/presenters/analyze/presenter.rb @@ -84,7 +84,7 @@ module Analyze @graphs ||= [Analyze::Graph::AllData.new, Analyze::Graph::StudentsAndTeachers.new, Analyze::Graph::StudentsByRace.new(races: selected_races), - Analyze::Graph::StudentsByGrade.new, + Analyze::Graph::StudentsByGrade.new(grades: selected_grades), Analyze::Graph::StudentsByGender.new(genders: selected_genders), Analyze::Graph::StudentsByIncome.new(incomes: selected_incomes), Analyze::Graph::StudentsByEll.new(ells: selected_ells), diff --git a/spec/presenters/analyze/presenter_spec.rb b/spec/presenters/analyze/presenter_spec.rb index 7ddbd6a4..25da2611 100644 --- a/spec/presenters/analyze/presenter_spec.rb +++ b/spec/presenters/analyze/presenter_spec.rb @@ -259,7 +259,7 @@ describe Analyze::Presenter do params = {graph: "students-by-grade"} presenter = Analyze::Presenter.new(params:, school:, academic_year:) - expect(presenter.graph.to_s).to eq Analyze::Graph::StudentsByGrade.new.to_s + expect(presenter.graph.to_s).to eq Analyze::Graph::StudentsByGrade.new(grades: nil).to_s params = {graph: "students-by-gender"} presenter = Analyze::Presenter.new(params:, school:, academic_year:)