mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 11:44:02 +00:00
* Survey period constraints * Add abilities * Enforce required questions * Update survey_submssion updated_at * Do a full match of possible answer and user reply
11 lines
268 B
Ruby
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
|