chore: start adding overview page

This commit is contained in:
Nelson Jovel 2024-01-17 12:49:23 -08:00
parent 1b0af124f7
commit 64b4d599c7
33 changed files with 783 additions and 199 deletions

View file

@ -1,9 +1,9 @@
module Dashboard
class Scale < ApplicationRecord
belongs_to :measure, class_name: "Measure", foreign_key: :dashboard_measure_id
has_many :survey_items
has_many :survey_items, class_name: "SurveyItem", foreign_key: :dashboard_scale_id
has_many :survey_item_responses, through: :survey_items
has_many :admin_data_items, class_name: "AdminDataItem", foreign_key: :admin_data_item_id
has_many :admin_data_items, class_name: "AdminDataItem", foreign_key: :dashboard_scale_id
def score(school:, academic_year:)
@score ||= Hash.new do |memo, (school, academic_year)|