Sha256: 0a49978149ead69c7f4e1a19af33eb40eec88ab37b1deb25f7760e1befdce371
Contents?: true
Size: 578 Bytes
Versions: 74
Compression:
Stored size: 578 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 evaluating) } validates :answer, translatable_presence: true, if: ->(form) { form.state == "rejected" } end end end end
Version data entries
74 entries across 74 versions & 2 rubygems