Sha256: a2354c4d085cd190db6b379fe4ac9cfa55fc331abf238ed73dd71319f5aaf4ac
Contents?: true
Size: 691 Bytes
Versions: 19
Compression:
Stored size: 691 Bytes
Contents
# frozen_string_literal: true module Decidim module Admin class UpdateExternalDomainWhitelist < Rectify::Command attr_reader :form, :organization def initialize(form, organization) @form = form @organization = organization end def call return broadcast(:invalid) if form.invalid? save_domains! broadcast(:ok) end private def save_domains! organization.external_domain_whitelist = form.external_domains.filter_map do |external_domain_form| external_domain_form.value unless external_domain_form.deleted end.flatten organization.save! end end end end
Version data entries
19 entries across 19 versions & 1 rubygems