Make sure when checking for sufficient gender responses that we only check student survey items

pull/1/head
rebuilt 3 years ago
parent e1c750b8d7
commit 2305e32f6d

@ -31,7 +31,7 @@ module Analyze
def sufficient_student_responses?(academic_year:) def sufficient_student_responses?(academic_year:)
yearly_counts = SurveyItemResponse.where(school:, academic_year:, yearly_counts = SurveyItemResponse.where(school:, academic_year:,
gender:).group(:gender).select(:response_id).distinct(:response_id).count gender:, survey_item: measure.student_survey_items).group(:gender).select(:response_id).distinct(:response_id).count
yearly_counts.any? do |count| yearly_counts.any? do |count|
count[1] >= 10 count[1] >= 10
end end

Loading…
Cancel
Save