Class: Decidim::Meetings::Admin::CloseMeeting
- Inherits:
-
Command
- Object
- Command
- Decidim::Meetings::Admin::CloseMeeting
- Defined in:
- app/commands/decidim/meetings/admin/close_meeting.rb
Overview
This command is executed when the user closes a Meeting from the admin panel.
Instance Method Summary collapse
-
#call ⇒ Object
Closes the meeting if valid.
-
#initialize(form, meeting) ⇒ CloseMeeting
constructor
Initializes a CloseMeeting Command.
Constructor Details
#initialize(form, meeting) ⇒ CloseMeeting
Initializes a CloseMeeting Command.
form - The form from which to get the data. meeting - The current instance of the page to be closed.
13 14 15 16 |
# File 'app/commands/decidim/meetings/admin/close_meeting.rb', line 13 def initialize(form, meeting) @form = form @meeting = meeting end |
Instance Method Details
#call ⇒ Object
Closes the meeting if valid.
Broadcasts :ok if successful, :invalid otherwise.
21 22 23 24 25 26 27 28 29 30 |
# File 'app/commands/decidim/meetings/admin/close_meeting.rb', line 21 def call return broadcast(:invalid) if form.invalid? transaction do close_meeting link_proposals end broadcast(:ok) end |