Class: Decidim::Admin::DestroyArea
- Inherits:
-
Commands::DestroyResource
- Object
- Commands::DestroyResource
- Decidim::Admin::DestroyArea
- Defined in:
- app/commands/decidim/admin/destroy_area.rb
Overview
A command with all the business logic to destroy an area.
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
Instance Method Details
#call ⇒ Object
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.
13 14 15 16 17 18 |
# File 'app/commands/decidim/admin/destroy_area.rb', line 13 def call destroy_resource broadcast(:ok) rescue ActiveRecord::RecordNotDestroyed broadcast(:has_spaces) end |