Sha256: 4dc66c6a38c93570519a133cbd6b35aaa3def945087bcbda42b8835583b0b4bd

Contents?: true

Size: 729 Bytes

Versions: 44

Compression:

Stored size: 729 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Forms
    module Admin
      # This class holds a Form to update questionnaire question matrixes from Decidim's admin panel.
      class QuestionMatrixRowForm < Decidim::Form
        include TranslatableAttributes

        attribute :position, Integer
        attribute :deleted, Boolean, default: false

        translatable_attribute :body, String

        validates :position, numericality: { greater_than_or_equal_to: 0 }, if: -> { position.present? }
        validates :body, translatable_presence: true, unless: :deleted

        def to_param
          return id if id.present?

          "questionnaire-question-matrix-row-id"
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

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