mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-13 01:10:39 -07:00
fix: Report::SurveyItemByGrade.create_grade_report now runs without errors
This commit is contained in:
parent
ae5c826583
commit
4472c3cc46
1 changed files with 4 additions and 4 deletions
|
|
@ -1,12 +1,12 @@
|
|||
module Report
|
||||
class SurveyItemByGrade
|
||||
def self.create_grade_report(schools:, academic_years:, filename:, use_student_survey_items: ::SurveyItem.student_survey_items.pluck(:id))
|
||||
data = to_csv(schools:, academic_years:, use_student_survey_items:)
|
||||
csv = to_csv(schools:, academic_years:, use_student_survey_items:)
|
||||
# write out file
|
||||
FileUtils.mkdir_p Rails.root.join("tmp", "reports")
|
||||
filepath = Rails.root.join("tmp", "reports", filename)
|
||||
write_csv(data:, filepath:)
|
||||
data
|
||||
write_csv(csv:, filepath:)
|
||||
csv
|
||||
end
|
||||
|
||||
def self.to_csv(schools:, academic_years:, use_student_survey_items:)
|
||||
|
|
@ -108,7 +108,7 @@ module Report
|
|||
end
|
||||
end
|
||||
|
||||
def self.write_csv(data:, filepath:)
|
||||
def self.write_csv(csv:, filepath:)
|
||||
File.write(filepath, csv)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue