Class: Decidim::ActionDelegator::Admin::FixResourcePermissions
- Inherits:
-
Command
- Object
- Command
- Decidim::ActionDelegator::Admin::FixResourcePermissions
- Defined in:
- app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(resources) ⇒ FixResourcePermissions
constructor
A new instance of FixResourcePermissions.
Constructor Details
#initialize(resources) ⇒ FixResourcePermissions
Returns a new instance of FixResourcePermissions.
7 8 9 10 |
# File 'app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb', line 7 def initialize(resources) @resources = resources @errors = [] end |
Instance Method Details
#call ⇒ Object
Executes the command. Broadcasts these events:
-
:ok when everything is valid.
-
:invalid if the form wasn’t valid and we couldn’t proceed.
Returns nothing.
18 19 20 21 22 23 24 25 26 |
# File 'app/commands/decidim/action_delegator/admin/fix_resource_permissions.rb', line 18 def call return broadcast(:invalid) if resources.blank? return broadcast(:invalid) if errors.any? broadcast(:ok) end |