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
This commit is contained in:
Stella Rouzi 2018-02-09 19:07:10 +02:00
parent c278e547ce
commit 683f62a27c
36 changed files with 219 additions and 74 deletions

View file

@ -1,7 +1,10 @@
# 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