mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
fix: make sure enrollment loader works
This commit is contained in:
parent
efe5f8909a
commit
6a9d04f7ff
1 changed files with 2 additions and 2 deletions
|
|
@ -77,7 +77,7 @@ class EnrollmentLoader
|
|||
def self.last_academic_year_with_data(school:)
|
||||
AcademicYear.all.order(range: :DESC).find do |academic_year|
|
||||
Respondent.where(school:, academic_year:).any? do |respondent|
|
||||
respondent.total_students.positive?
|
||||
respondent&.total_students&.positive?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -85,7 +85,7 @@ class EnrollmentLoader
|
|||
def self.academic_years_without_data(school:)
|
||||
AcademicYear.all.order(range: :DESC).reject do |academic_year|
|
||||
Respondent.where(school:, academic_year:).any? do |respondent|
|
||||
respondent.total_students.positive?
|
||||
respondent&.total_students&.positive?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue