Class: Decidim::Elections::Admin::ReportMissingTrustee
- Inherits:
-
Command
- Object
- Command
- Decidim::Elections::Admin::ReportMissingTrustee
- Defined in:
- app/commands/decidim/elections/admin/report_missing_trustee.rb
Overview
This command gets called to report a missing trustee during the tally process.
Instance Method Summary collapse
-
#call ⇒ Object
Public: Reports the missing trustee for the Election tally process.
-
#initialize(form) ⇒ ReportMissingTrustee
constructor
Public: Initializes the command.
Constructor Details
#initialize(form) ⇒ ReportMissingTrustee
Public: Initializes the command.
form - A ReportMissingTrusteeForm object with the information needed to report the missing trustee.
11 12 13 |
# File 'app/commands/decidim/elections/admin/report_missing_trustee.rb', line 11 def initialize(form) @form = form end |
Instance Method Details
#call ⇒ Object
Public: Reports the missing trustee for the Election tally process.
Broadcasts :ok if it worked, :invalid otherwise.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/commands/decidim/elections/admin/report_missing_trustee.rb', line 18 def call return broadcast(:invalid) if form.invalid? transaction do log_action report_missing_trustee end broadcast(:ok) rescue StandardError => e broadcast(:invalid, e.) end |