remove boston admin categories

pull/1/head
Jared Cosulich 7 years ago
parent bf5e4f3d8f
commit 93b0267dad

@ -30,6 +30,11 @@ class CategoriesController < ApplicationController
next if category.benchmark.present? next if category.benchmark.present?
@child_school_categories << category.school_categories.new(school: @school) @child_school_categories << category.school_categories.new(school: @school)
end end
if district.name == "Boston"
@child_school_categories = @child_school_categories.reject { |csc| csc.admin? }
end
@questions = @category.questions.created_in(@year) @questions = @category.questions.created_in(@year)
end end

@ -16,6 +16,11 @@ class SchoolCategory < ApplicationRecord
scope :valid, -> { where("zscore is not null or valid_child_count is not null") } scope :valid, -> { where("zscore is not null or valid_child_count is not null") }
def admin?
category.child_categories.each { |cc| return false if cc.benchmark.blank? }
return true
end
def root_index def root_index
category.root_index category.root_index
end end

Loading…
Cancel
Save