Sha256: 70274a2a42f71637d424ce2c2f9c5f6397f8b64a69ccfc8e5afc87da3bea5c95
Contents?: true
Size: 973 Bytes
Versions: 16
Compression:
Stored size: 973 Bytes
Contents
# frozen_string_literal: true module Decidim module ParticipatoryProcesses module Admin # A form object used to copy a participatory processes from the admin # dashboard. # class ParticipatoryProcessCopyForm < Form include TranslatableAttributes translatable_attribute :title, String mimic :participatory_process attribute :slug, String attribute :copy_steps, Boolean attribute :copy_categories, Boolean attribute :copy_features, Boolean validates :slug, presence: true, format: { with: Decidim::ParticipatoryProcess.slug_format } validates :title, translatable_presence: true validate :slug_uniqueness private def slug_uniqueness return unless OrganizationParticipatoryProcesses.new(current_organization).query.where(slug: slug).where.not(id: id).any? errors.add(:slug, :taken) end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems