mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
Switch the logic of empty dataset detection from none? to any?
This commit is contained in:
parent
2d3ee28cc3
commit
a1689a3550
2 changed files with 4 additions and 4 deletions
|
|
@ -16,9 +16,9 @@ class OverviewController < SqmApplicationController
|
|||
end
|
||||
|
||||
def check_empty_dataset
|
||||
@has_empty_dataset = subcategories.all? do |subcategory|
|
||||
@has_empty_dataset = !subcategories.any? do |subcategory|
|
||||
response_rate = subcategory.response_rate(school: @school, academic_year: @academic_year)
|
||||
!response_rate.meets_student_threshold && !response_rate.meets_teacher_threshold
|
||||
response_rate.meets_student_threshold || response_rate.meets_teacher_threshold
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -73,9 +73,9 @@ module AnalyzeHelper
|
|||
|
||||
def empty_dataset?(measures:, school:, academic_year:)
|
||||
@empty_dataset ||= Hash.new do |memo, (school, academic_year)|
|
||||
memo[[school, academic_year]] = measures.all? do |measure|
|
||||
memo[[school, academic_year]] = !measures.any? do |measure|
|
||||
response_rate = measure.subcategory.response_rate(school:, academic_year:)
|
||||
!response_rate.meets_student_threshold && !response_rate.meets_teacher_threshold
|
||||
response_rate.meets_student_threshold || response_rate.meets_teacher_threshold
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue