Add one_off script for loading 2022-23 data

This commit is contained in:
rebuilt 2023-02-12 16:54:54 -08:00
parent 01851d8527
commit 83ab2cfef0
2 changed files with 39 additions and 2 deletions

View file

@ -36,12 +36,13 @@ namespace :data do
task load_survey_responses_for_lowell: :environment do
survey_item_response_count = SurveyItemResponse.count
student_count = Student.count
Sftp::Directory.open(path: '/data/survey_responses/clean/') do |file|
path = '/data/survey_responses/clean/'
Sftp::Directory.open(path:) do |file|
SurveyResponsesDataLoader.from_file(file:)
end
puts "=====================> Completed loading #{SurveyItemResponse.count - survey_item_response_count} survey responses. #{SurveyItemResponse.count} total responses in the database"
Sftp::Directory.open(path: '/data/survey_responses/clean/') do |file|
Sftp::Directory.open(path:) do |file|
StudentLoader.from_file(file:, rules: [Rule::SkipNonLowellSchools])
end
puts "=====================> Completed loading #{Student.count - student_count} students. #{Student.count} total students"