Sha256: 435c2bf0bf76dfb03f103be8a677d3c140f724d17596a7fbe030ed4cb664699d
Contents?: true
Size: 818 Bytes
Versions: 18
Compression:
Stored size: 818 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 validates :title, translatable_presence: true validate :slug, :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
18 entries across 18 versions & 2 rubygems