osem-fcy/app/models/survey_reply.rb
Stella Rouzi 683f62a27c Add more options for surveys
* Survey period constraints
* Add abilities
* Enforce required questions
* Update survey_submssion updated_at
* Do a full match of possible answer and user reply
2018-07-03 08:46:15 +03:00

10 lines
265 B
Ruby

# frozen_string_literal: true
class SurveyReply < ActiveRecord::Base
belongs_to :user
belongs_to :survey_question
serialize :text
validates :user_id, :survey_question_id, presence: true
validates :survey_question_id, uniqueness: { scope: :user_id }
end