fix: correctly reference SurveyItemResponse in Subcategory report

rpp-main
Nelson Jovel 1 year ago
parent 2a97a0f589
commit 491e50c55d

@ -23,9 +23,9 @@ module Report
score = subcategory.score(school:, academic_year:)
zone = subcategory.zone(school:, academic_year:).type.to_s.capitalize
begin_date = SurveyItemResponse.where(school:,
begin_date = ::SurveyItemResponse.where(school:,
academic_year:).where.not(recorded_date: nil).order(:recorded_date).first&.recorded_date&.to_date
end_date = SurveyItemResponse.where(school:,
end_date = ::SurveyItemResponse.where(school:,
academic_year:).where.not(recorded_date: nil).order(:recorded_date).last&.recorded_date&.to_date
date_range = "#{begin_date} - #{end_date}"

Loading…
Cancel
Save