Sha256: 182a5bb6bd238eeda796a2a5a49daddd782246086c53cb96ac1a53d0b31d86de
Contents?: true
Size: 567 Bytes
Versions: 10
Compression:
Stored size: 567 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
10 entries across 10 versions & 2 rubygems