Sha256: ace856dee1b74a03616f548ca8a0b5958755bccc1b6277f0bf98288d17e4efa9
Contents?: true
Size: 837 Bytes
Versions: 6
Compression:
Stored size: 837 Bytes
Contents
# frozen_string_literal: true module Decidim 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 validates :title, translatable_presence: true validate :slug, :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
Version data entries
6 entries across 6 versions & 2 rubygems