Sha256: c401199b0a1ea6c17e25bde03fc36dc813974e3554345b3ba93ac32eb3e92a62
Contents?: true
Size: 837 Bytes
Versions: 24
Compression:
Stored size: 837 Bytes
Contents
# frozen_string_literal: true module Decidim module Surveys module Admin # This class holds a Form to update survey questions from Decidim's admin panel. class SurveyQuestionForm < Decidim::Form include TranslatableAttributes attribute :id, String attribute :position, Integer attribute :mandatory, Boolean, default: false attribute :question_type, String attribute :answer_options, Array[SurveyQuestionAnswerOptionForm] attribute :deleted, Boolean, default: false translatable_attribute :body, String validates :position, numericality: { greater_than_or_equal_to: 0 } validates :question_type, inclusion: { in: SurveyQuestion::TYPES } validates :body, translatable_presence: true, unless: :deleted end end end end
Version data entries
24 entries across 24 versions & 2 rubygems