From d324d53bd2184c954ad6b807ffc57e366303e7bb Mon Sep 17 00:00:00 2001 From: Jared Cosulich Date: Thu, 8 Aug 2019 12:10:38 -0400 Subject: [PATCH] year scope for school_questions --- app/models/school_question.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/school_question.rb b/app/models/school_question.rb index 03c0f46e..91136ead 100644 --- a/app/models/school_question.rb +++ b/app/models/school_question.rb @@ -9,6 +9,7 @@ class SchoolQuestion < ApplicationRecord validates_associated :school_category scope :for, -> (school, question) { where(school_id: school.id, question_id: question.id) } + scope :in, -> (year) { where(year: year) } def sync_attempts attempt_data = Attempt.