mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
fix: If all respondents have total_teachers set to 0, that will trigger cloning previous year data
This commit is contained in:
parent
90363d8b86
commit
3106768175
1 changed files with 1 additions and 1 deletions
|
|
@ -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).count.zero?
|
||||
missing_staffing_for_current_yea = Respondent.where(academic_year: AcademicYear.order(:range).last).group(:total_teachers).having("total_teachers > 0").count.count
|
||||
|
||||
StaffingLoader.clone_previous_year_data if missing_staffing_for_current_year
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue