mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
show all categories on school page
This commit is contained in:
parent
a0e634c993
commit
9ff4cf0d10
2 changed files with 17 additions and 2 deletions
|
|
@ -25,6 +25,10 @@ class Category < ApplicationRecord
|
|||
end
|
||||
|
||||
def root_index
|
||||
Category.root_identifiers.index(root_identifier) || 0
|
||||
end
|
||||
|
||||
def self.root_identifiers
|
||||
[
|
||||
"teachers-and-the-teaching-environment",
|
||||
"school-culture",
|
||||
|
|
@ -32,7 +36,11 @@ class Category < ApplicationRecord
|
|||
"academic-learning",
|
||||
"community-and-wellbeing",
|
||||
"pilot-family-questions"
|
||||
].index(root_identifier) || 0
|
||||
]
|
||||
end
|
||||
|
||||
def self.root
|
||||
Category.where(parent_category: nil).select { |c| self.root_identifiers.index(c.slug) }
|
||||
end
|
||||
|
||||
def custom_zones
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue