Sha256: 5e06e6610f67f43df70ecec328516f4980e952cf2fad038542b764b04c64159f
Contents?: true
Size: 754 Bytes
Versions: 14
Compression:
Stored size: 754 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 < Rectify::Form include TranslatableAttributes mimic :organization attribute :name, String attribute :host, String translatable_attribute :description, 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
14 entries across 14 versions & 2 rubygems