Class: Decidim::Voca::Organization::UpdatePermissionCommand
- Inherits:
-
OrganizationCommand
- Object
- Command
- OrganizationCommand
- Decidim::Voca::Organization::UpdatePermissionCommand
- Defined in:
- app/commands/decidim/voca/organization/update_permission_command.rb
Instance Attribute Summary collapse
-
#permission_settings ⇒ Object
readonly
Returns the value of attribute permission_settings.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(permission_settings) ⇒ UpdatePermissionCommand
constructor
A new instance of UpdatePermissionCommand.
Methods inherited from OrganizationCommand
#command_name, command_name, #organization
Constructor Details
#initialize(permission_settings) ⇒ UpdatePermissionCommand
Returns a new instance of UpdatePermissionCommand.
6 7 8 |
# File 'app/commands/decidim/voca/organization/update_permission_command.rb', line 6 def initialize() @permission_settings = (.to_h) end |
Instance Attribute Details
#permission_settings ⇒ Object (readonly)
Returns the value of attribute permission_settings.
5 6 7 |
# File 'app/commands/decidim/voca/organization/update_permission_command.rb', line 5 def @permission_settings end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/commands/decidim/voca/organization/update_permission_command.rb', line 10 def call organization.update!(.delete_if { |_k, v| v.blank? }) broadcast(:ok) rescue e Rails.logger.error(e) broadcast(:fail) end |