Sha256: 67924e482f50a287ab5da3c872fffb207d6d2930a623c8d23c86a431a32d2d8d
Contents?: true
Size: 872 Bytes
Versions: 14
Compression:
Stored size: 872 Bytes
Contents
# frozen_string_literal: true module Decidim module Assemblies module Admin # A form object used to copy a assemblies from the admin # dashboard. # class AssemblyCopyForm < Form include TranslatableAttributes translatable_attribute :title, String mimic :assembly attribute :slug, String 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 OrganizationAssemblies.new(current_organization).query.where(slug: slug).where.not(id: id).any? errors.add(:slug, :taken) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems