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

Version Path
decidim-surveys-0.10.1 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.10.0 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.9.3 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.9.2 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.9.1 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.9.0 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.8.4 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.8.3 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.8.2 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.8.1 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.8.0 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.7.4 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.7.3 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.7.2 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.7.1 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.7.0 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.6.8 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-0.6.8 decidim-surveys/app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-surveys-0.6.7 app/forms/decidim/surveys/admin/survey_question_form.rb
decidim-0.6.7 decidim-surveys/app/forms/decidim/surveys/admin/survey_question_form.rb