mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
chore: Make sure survey items are uniq by survey item ids
This commit is contained in:
parent
848fccf55f
commit
830b7bdfea
3 changed files with 10 additions and 2 deletions
|
|
@ -7,6 +7,8 @@ class SurveyItem < ActiveRecord::Base
|
|||
|
||||
has_many :survey_item_responses
|
||||
|
||||
validates :survey_item_id, uniqueness: true
|
||||
|
||||
def score(school:, academic_year:)
|
||||
@score ||= Hash.new do |memo, (school, academic_year)|
|
||||
memo[[school, academic_year]] =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue