mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
feat: add 2023-24 academic year and make sure previous year enrollment
and staffing data get loaded when missing
This commit is contained in:
parent
e203be056a
commit
6541b87e9c
4 changed files with 49 additions and 17 deletions
|
|
@ -121,15 +121,19 @@ class Seeder
|
|||
|
||||
def seed_enrollment(csv_file)
|
||||
EnrollmentLoader.load_data(filepath: csv_file)
|
||||
missing_enrollment_for_current_year = Respondent.where(academic_year: AcademicYear.order(:range).last).none? do |respondent|
|
||||
respondent&.total_students&.zero?
|
||||
end
|
||||
|
||||
EnrollmentLoader.clone_previous_year_data if missing_enrollment_for_current_year
|
||||
end
|
||||
|
||||
def seed_staffing(csv_file)
|
||||
StaffingLoader.load_data(filepath: csv_file)
|
||||
missing_staffing_for_current_year = Respondent.where(academic_year: AcademicYear.order(:range).last).none? do |respondent|
|
||||
respondent.total_teachers.present?
|
||||
respondent&.total_teachers&.zero?
|
||||
end
|
||||
|
||||
# This will also clone previous year enrollment data
|
||||
StaffingLoader.clone_previous_year_data if missing_staffing_for_current_year
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue