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