Sha256: 17e1990257679a7b2239b58c17a1a13c01506a8e717d2eece449426ffb091022
Contents?: true
Size: 1.05 KB
Versions: 24
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true module Decidim module ParticipatoryProcesses module Admin # A form object used to create participatory processes steps from the admin # dashboard. # class ParticipatoryProcessStepForm < Form include TranslatableAttributes translatable_attribute :title, String translatable_attribute :description, String translatable_attribute :cta_text, String mimic :participatory_process_step attribute :start_date, Decidim::Attributes::LocalizedDate attribute :end_date, Decidim::Attributes::LocalizedDate attribute :cta_path, String validates :title, translatable_presence: true validates :cta_path, format: { with: %r{\A[a-zA-Z]+[a-zA-Z0-9\-\_/]+\z} }, allow_blank: true validates :start_date, date: { before: :end_date, allow_blank: true, if: proc { |obj| obj.end_date.present? } } validates :end_date, date: { after: :start_date, allow_blank: true, if: proc { |obj| obj.start_date.present? } } end end end end
Version data entries
24 entries across 24 versions & 1 rubygems