sqm-dashboards/app/models/admin_data_item.rb
rebuilt fcec3de233 Modify collection rate for admin data items. Take into account if a
school is a high school and if the admin data item is for high schools
only.  Finishes: #181154375.
2022-02-11 18:54:14 +01:00

11 lines
280 B
Ruby

class AdminDataItem < ActiveRecord::Base
belongs_to :measure
scope :for_measures, ->(measure) {
joins(:measure).where('admin_data_items.measure': measure)
}
scope :non_hs_items_for_measures, ->(measure) {
for_measures(measure).where(hs_only_item: false)
}
end