fix: fix crash when viewing income graph on analyze page

pull/2/head
rebuilt 2 years ago
parent aaa43cdd64
commit 8d33095a48

@ -31,11 +31,9 @@ module Analyze
yearly_counts = SurveyItemResponse.where(school:, academic_year:, yearly_counts = SurveyItemResponse.where(school:, academic_year:,
income:, survey_item: measure.student_survey_items).group(:income).select(:response_id).distinct(:response_id).count income:, survey_item: measure.student_survey_items).group(:income).select(:response_id).distinct(:response_id).count
more_than_ten_respondents = yearly_counts.any? do |count| yearly_counts.any? do |count|
count[1] >= 10 count[1] >= 10
end end
sufficient_overall_responses && more_than_ten_respondents
end end
end end
end end

Loading…
Cancel
Save