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

Version Path
decidim-forms-0.29.1 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.28.4 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.27.9 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.29.0 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.28.3 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.27.8 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.29.0.rc4 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.29.0.rc3 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.29.0.rc2 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.29.0.rc1 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.28.2 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.27.7 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.28.1 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.27.6 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.26.10 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.26.9 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.28.0 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.27.5 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.28.0.rc5 app/models/decidim/forms/answer_choice.rb
decidim-forms-0.28.0.rc4 app/models/decidim/forms/answer_choice.rb