mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Memoize schools in SurveyItemValues and academic_years in AcademicYear
for performace improvement
This commit is contained in:
parent
282a671531
commit
05bff3ee89
1 changed files with 2 additions and 2 deletions
|
|
@ -57,7 +57,7 @@ class SurveyItemValues
|
|||
end
|
||||
|
||||
def schools
|
||||
School.all.map { |school| [school.dese_id, school] }.to_h
|
||||
@schools ||= School.all.map { |school| [school.dese_id, school] }.to_h
|
||||
end
|
||||
|
||||
def grade
|
||||
|
|
@ -65,7 +65,7 @@ class SurveyItemValues
|
|||
raw_grade = (row['grade'] || row['Grade'] || row['What grade are you in?'])
|
||||
return nil if raw_grade.blank?
|
||||
|
||||
raw_grade = raw_grade.to_i
|
||||
raw_grade.to_i
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue