sqm-dashboards/app/models/survey_item_response.rb
2022-06-16 16:14:03 -07:00

14 lines
465 B
Ruby

class SurveyItemResponse < ActiveRecord::Base
TEACHER_RESPONSE_THRESHOLD = 2
STUDENT_RESPONSE_THRESHOLD = 2
belongs_to :academic_year
belongs_to :school
belongs_to :survey_item, counter_cache: true
has_one :measure, through: :survey_item
scope :exclude_boston, lambda {
boston = District.find_by_name('Boston')
where.not(school: boston.schools) if boston.present?
}
end