Sha256: 1babd17a05909af12700569b7d534d9fd6805a2e64baaee15af512e82379784b

Contents?: true

Size: 559 Bytes

Versions: 6

Compression:

Stored size: 559 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # A command with all the business logic to destroy an area.
    class DestroyArea < Decidim::Commands::DestroyResource
      # Executes the command. Broadcasts these events:
      #
      # - :ok when everything is valid.
      # - :invalid if the form was not valid and we could not proceed.
      #
      # Returns nothing.
      def call
        destroy_resource
        broadcast(:ok)
      rescue ActiveRecord::RecordNotDestroyed
        broadcast(:has_spaces)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-admin-0.29.1 app/commands/decidim/admin/destroy_area.rb
decidim-admin-0.29.0 app/commands/decidim/admin/destroy_area.rb
decidim-admin-0.29.0.rc4 app/commands/decidim/admin/destroy_area.rb
decidim-admin-0.29.0.rc3 app/commands/decidim/admin/destroy_area.rb
decidim-admin-0.29.0.rc2 app/commands/decidim/admin/destroy_area.rb
decidim-admin-0.29.0.rc1 app/commands/decidim/admin/destroy_area.rb