mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Renamed remove_zeros method to remove_blanks
This commit is contained in:
parent
01d4448fde
commit
62b6503816
2 changed files with 3 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ class Scale < ApplicationRecord
|
|||
items << collect_survey_item_average(student_survey_items(school:, academic_year:), school, academic_year)
|
||||
items << collect_survey_item_average(teacher_survey_items, school, academic_year)
|
||||
|
||||
items.remove_zeros.average
|
||||
items.remove_blanks.average
|
||||
end
|
||||
end
|
||||
@score[[school, academic_year]]
|
||||
|
|
@ -29,7 +29,7 @@ class Scale < ApplicationRecord
|
|||
def collect_survey_item_average(survey_items, school, academic_year)
|
||||
survey_items.map do |survey_item|
|
||||
survey_item.score(school:, academic_year:)
|
||||
end.remove_zeros.average
|
||||
end.remove_blanks.average
|
||||
end
|
||||
|
||||
def teacher_survey_items
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ module ArrayMonkeyPatches
|
|||
sum.to_f / size
|
||||
end
|
||||
|
||||
def remove_zeros
|
||||
def remove_blanks
|
||||
reject { |item| item == 0 || item.to_f.nan? }
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue