mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-19 18:36:24 -07:00
chore: fixed seeder.
This commit is contained in:
parent
0af7d42e52
commit
1b0af124f7
4 changed files with 17 additions and 33 deletions
|
|
@ -5,15 +5,12 @@ require "csv"
|
|||
module Dashboard
|
||||
class EnrollmentLoader
|
||||
def load_data(filepath:)
|
||||
schools = []
|
||||
enrollments = []
|
||||
CSV.parse(File.read(filepath), headers: true) do |row|
|
||||
row = EnrollmentRowValues.new(row:, schools: school_hash, academic_years: academic_year_hash)
|
||||
|
||||
next unless row.school.present? && row.academic_year.present?
|
||||
|
||||
schools << row.school
|
||||
|
||||
enrollments << create_enrollment_entry(row:)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue