You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sqm-dashboards/app/models/school_question.rb

14 lines
321 B

class SchoolQuestion < ApplicationRecord
belongs_to :school
belongs_to :question
belongs_to :school_category
validates_associated :school
validates_associated :question
validates_associated :school_category
scope :for, -> (school, question) { where(school_id: school.id, question_id: question.id) }
end