Sha256: 905889635e2eb68f2bdf04c723a7f3ab1b9ca3d834daba20f3b5834e509cf0f9

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Forms
    module Admin
      # This class holds a Form to update answer options
      class AnswerOptionForm < Decidim::Form
        include TranslatableAttributes

        attribute :deleted, Boolean, default: false
        attribute :free_text, Boolean

        translatable_attribute :body, String

        validates :body, translatable_presence: true, unless: :deleted

        def to_param
          id || "questionnaire-question-answer-option-id"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
decidim-forms-0.16.1 app/forms/decidim/forms/admin/answer_option_form.rb
decidim-forms-0.16.0 app/forms/decidim/forms/admin/answer_option_form.rb