Sha256: 0ec8116ce6d1e9ffd7c9da107eb13c1c0ff673e19996a79d2735542ad2ae490b
Contents?: true
Size: 566 Bytes
Versions: 13
Compression:
Stored size: 566 Bytes
Contents
# frozen_string_literal: true module Decidim module Proposals module Admin # A form object to be used when admin users want to answer a proposal. class ProposalAnswerForm < Decidim::Form include TranslatableAttributes mimic :proposal_answer translatable_attribute :answer, String attribute :state, String validates :state, presence: true, inclusion: { in: %w(accepted rejected) } validates :answer, translatable_presence: true, if: ->(form) { form.state == "rejected" } end end end end
Version data entries
13 entries across 13 versions & 2 rubygems