mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
chore: memoize grades for school
This commit is contained in:
parent
d2efec1574
commit
db7c74479d
1 changed files with 1 additions and 1 deletions
|
|
@ -21,6 +21,6 @@ class School < ApplicationRecord
|
|||
end
|
||||
|
||||
def grades(academic_year:)
|
||||
Respondent.find_by(school: self, academic_year:)&.enrollment_by_grade&.keys || (-1..12).to_a
|
||||
@grades ||= Respondent.find_by(school: self, academic_year:)&.enrollment_by_grade&.keys || (-1..12).to_a
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue