Class: Decidim::DecidimAwesome::Admin::UpdateAwesomeAuthorizationGroup
- Inherits:
-
Command
- Object
- Command
- Command
- Decidim::DecidimAwesome::Admin::UpdateAwesomeAuthorizationGroup
- Defined in:
- app/commands/decidim/decidim_awesome/admin/update_awesome_authorization_group.rb
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(form, authorization_group) ⇒ UpdateAwesomeAuthorizationGroup
constructor
Public: Initializes the command.
Constructor Details
#initialize(form, authorization_group) ⇒ UpdateAwesomeAuthorizationGroup
Public: Initializes the command.
form - The form object with the authorization group data authorization_group - The authorization group to update
11 12 13 14 |
# File 'app/commands/decidim/decidim_awesome/admin/update_awesome_authorization_group.rb', line 11 def initialize(form, ) @form = form @authorization_group = end |
Instance Method Details
#call ⇒ Object
Executes the command. Broadcasts these events:
- :ok when everything is valid.
- :invalid if we couldn't proceed.
Returns nothing.
22 23 24 25 26 27 28 29 30 |
# File 'app/commands/decidim/decidim_awesome/admin/update_awesome_authorization_group.rb', line 22 def call return broadcast(:invalid, form.errors..join("; ")) if form.invalid? broadcast(:ok, ) rescue StandardError => e broadcast(:invalid, e.) end |