Sha256: 1178af52325d8a566f34584f48d279029f41a0479a41bea8cddff49e89cfc983
Contents?: true
Size: 638 Bytes
Versions: 59
Compression:
Stored size: 638 Bytes
Contents
# frozen_string_literal: true module Decidim module Forms class AnswerChoice < Forms::ApplicationRecord belongs_to :answer, class_name: "Answer", foreign_key: "decidim_answer_id" belongs_to :answer_option, class_name: "AnswerOption", foreign_key: "decidim_answer_option_id" belongs_to :matrix_row, class_name: "QuestionMatrixRow", foreign_key: "decidim_question_matrix_row_id", optional: true validates :matrix_row, presence: true, if: -> { answer.question.matrix? } end end end
Version data entries
59 entries across 59 versions & 1 rubygems