Memoize schools in SurveyItemValues and academic_years in AcademicYear

for performace improvement
rpp-main
rebuilt 3 years ago
parent 282a671531
commit 05bff3ee89

@ -57,7 +57,7 @@ class SurveyItemValues
end end
def schools def schools
School.all.map { |school| [school.dese_id, school] }.to_h @schools ||= School.all.map { |school| [school.dese_id, school] }.to_h
end end
def grade def grade
@ -65,7 +65,7 @@ class SurveyItemValues
raw_grade = (row['grade'] || row['Grade'] || row['What grade are you in?']) raw_grade = (row['grade'] || row['Grade'] || row['What grade are you in?'])
return nil if raw_grade.blank? return nil if raw_grade.blank?
raw_grade = raw_grade.to_i raw_grade.to_i
end end
end end

Loading…
Cancel
Save