mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-07 21:38:14 -08:00
chore: seed framework
This commit is contained in:
parent
cd7b05df73
commit
27550e0b30
10 changed files with 83 additions and 82 deletions
|
|
@ -6,7 +6,7 @@ module Dashboard
|
|||
academic_years << { range: }
|
||||
end
|
||||
|
||||
AcademicYear.insert_all(academic_years, unique_by: [:id])
|
||||
AcademicYear.upsert_all(academic_years)
|
||||
end
|
||||
|
||||
def seed_districts_and_schools(csv_file)
|
||||
|
|
@ -30,7 +30,7 @@ module Dashboard
|
|||
is_hs: marked?(hs), slug: school_name.parameterize }
|
||||
end
|
||||
|
||||
School.upsert_all(schools)
|
||||
School.insert_all(schools)
|
||||
|
||||
Respondent.joins(:school).where.not("school.dese_id": dese_ids).destroy_all
|
||||
School.where.not(dese_id: dese_ids).destroy_all
|
||||
|
|
@ -93,7 +93,7 @@ module Dashboard
|
|||
end
|
||||
end
|
||||
|
||||
AdminDataValue.where.not(admin_data_item_id: admin_data_item_ids).delete_all
|
||||
AdminDataValue.where.not(admin_data_item: admin_data_item_ids).delete_all
|
||||
AdminDataItem.where.not(id: admin_data_item_ids).delete_all
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue