mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-14 09:15:54 -07:00
dirty commit: can't get references to work correctly between any tables
This commit is contained in:
parent
e1f0b78236
commit
a4fddbeced
183 changed files with 5461 additions and 5 deletions
28
app/models/dashboard/score.rb
Normal file
28
app/models/dashboard/score.rb
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
module Dashboard
|
||||
class Score < ApplicationRecord
|
||||
belongs_to :dashboard_measure
|
||||
belongs_to :dashboard_school
|
||||
belongs_to :dashboard_academic_year
|
||||
belongs_to :dashboard_race
|
||||
|
||||
NIL_SCORE = Score.new(average: nil, meets_teacher_threshold: false, meets_student_threshold: false,
|
||||
meets_admin_data_threshold: false)
|
||||
|
||||
enum group: {
|
||||
all_students: 0,
|
||||
race: 1,
|
||||
grade: 2,
|
||||
gender: 3
|
||||
}
|
||||
|
||||
def in_zone?(zone:)
|
||||
return false if average.nil? || average.is_a?(Float) && average.nan?
|
||||
|
||||
average.between?(zone.low_benchmark, zone.high_benchmark)
|
||||
end
|
||||
|
||||
def blank?
|
||||
average.nil? || average.zero? || average.nan?
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue