Sha256: 3849088b9e077a4f047187993be56d8f8a184d99f6bf09487ac0514f0222804f
Contents?: true
Size: 694 Bytes
Versions: 9
Compression:
Stored size: 694 Bytes
Contents
# frozen_string_literal: true require "decidim/translatable_attributes" module Decidim module System # A form object used to update organizations from the system dashboard. # class UpdateOrganizationForm < Form include TranslatableAttributes mimic :organization attribute :name, String attribute :host, String validate :validate_organization_uniqueness private def validate_organization_uniqueness errors.add(:name, :taken) if Decidim::Organization.where(name: name).where.not(id: id).exists? errors.add(:host, :taken) if Decidim::Organization.where(host: host).where.not(id: id).exists? end end end end
Version data entries
9 entries across 9 versions & 2 rubygems