fix: make sure staffing checks for zero

This commit is contained in:
Nelson Jovel 2024-04-01 09:52:41 -07:00
parent ad23bb1816
commit 8a702efa51

View file

@ -129,7 +129,7 @@ class Seeder
def seed_staffing(csv_file)
StaffingLoader.load_data(filepath: csv_file)
missing_staffing_for_current_year = Respondent.where(academic_year: AcademicYear.order(:range).last).group(:total_teachers).having("total_teachers > 0").count.count
missing_staffing_for_current_year = Respondent.where(academic_year: AcademicYear.order(:range).last).group(:total_teachers).having("total_teachers > 0").count.count.zero?
StaffingLoader.clone_previous_year_data if missing_staffing_for_current_year
end