mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
propogate up valid_child_count for admin data
This commit is contained in:
parent
5f89245ca0
commit
ef3d0186a5
2 changed files with 20 additions and 24 deletions
|
|
@ -382,6 +382,18 @@ namespace :data do
|
|||
valid_child_count: 1
|
||||
)
|
||||
end
|
||||
|
||||
pc = nonlikert_category.parent_category
|
||||
while pc != nil
|
||||
psc = SchoolCategory.for(school, pc).in(school_category.year).first
|
||||
if psc != nil
|
||||
psc.update(valid_child_count: (psc.valid_child_count || 0) + 1)
|
||||
pc = pc.parent_category
|
||||
else
|
||||
pc = nil
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
ENV.delete('BULK_PROCESS')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue