Sha256: 24950ba41d9de69342e5cba4c7d0c6566d9324ca0522b25ee05d039e7a928d89
Contents?: true
Size: 871 Bytes
Versions: 60
Compression:
Stored size: 871 Bytes
Contents
# frozen_string_literal: true module Decidim module Conferences module Admin # A form object used to copy a conferences from the admin # dashboard. # class ConferenceCopyForm < Form include TranslatableAttributes translatable_attribute :title, String mimic :conference attribute :slug, String attribute :copy_categories, Boolean attribute :copy_components, Boolean validates :slug, presence: true, format: { with: Decidim::Conference.slug_format } validates :title, translatable_presence: true validate :slug_uniqueness private def slug_uniqueness return unless OrganizationConferences.new(current_organization).query.where(slug: slug).where.not(id: id).any? errors.add(:slug, :taken) end end end end end
Version data entries
60 entries across 60 versions & 1 rubygems