osem-fcy/app/models/survey_submission.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

11 lines
268 B
Ruby

# frozen_string_literal: true
class SurveySubmission < ActiveRecord::Base
belongs_to :user
belongs_to :survey
has_many :survey_replies, through: :user
validates :user_id, uniqueness: { scope: :survey_id }
accepts_nested_attributes_for :survey_replies
end