Class: Decidim::Admin::DestroyStaticPage
- Inherits:
-
Command
- Object
- Command
- Decidim::Admin::DestroyStaticPage
- Defined in:
- app/commands/decidim/admin/destroy_static_page.rb
Overview
This command deals with destroying a StaticPage from the admin panel.
Instance Method Summary collapse
-
#call ⇒ Object
Public: Executes the command.
-
#initialize(page, current_user) ⇒ DestroyStaticPage
constructor
Public: Initializes the command.
Constructor Details
#initialize(page, current_user) ⇒ DestroyStaticPage
Public: Initializes the command.
page - The StaticPage to be destroyed.
10 11 12 13 |
# File 'app/commands/decidim/admin/destroy_static_page.rb', line 10 def initialize(page, current_user) @page = page @current_user = current_user end |
Instance Method Details
#call ⇒ Object
Public: Executes the command.
Broadcasts :ok if it got destroyed
18 19 20 21 |
# File 'app/commands/decidim/admin/destroy_static_page.rb', line 18 def call destroy_page broadcast(:ok) end |