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