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:
parent
c278e547ce
commit
683f62a27c
36 changed files with 219 additions and 74 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue