Class: Decidim::Elections::Admin::StartKeyCeremony
- Inherits:
-
Command
- Object
- Command
- Decidim::Elections::Admin::StartKeyCeremony
- Defined in:
- app/commands/decidim/elections/admin/start_key_ceremony.rb
Overview
This command gets called to start the key ceremony in the Bulletin Board.
Instance Method Summary collapse
-
#call ⇒ Object
Public: Starts the key ceremony for the Election.
-
#initialize(form) ⇒ StartKeyCeremony
constructor
Public: Initializes the command.
Constructor Details
#initialize(form) ⇒ StartKeyCeremony
Public: Initializes the command.
form - An ActionForm object with the information needed to perform an action
11 12 13 |
# File 'app/commands/decidim/elections/admin/start_key_ceremony.rb', line 11 def initialize(form) @form = form end |
Instance Method Details
#call ⇒ Object
Public: Starts the key ceremony for the Election.
Broadcasts :ok if setup, :invalid otherwise.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/commands/decidim/elections/admin/start_key_ceremony.rb', line 18 def call return broadcast(:invalid) if form.invalid? transaction do log_action start_key_ceremony end broadcast(:ok) rescue StandardError => e broadcast(:invalid, e.) end |