Class: Decidim::Voca::Organization::UpdateFileUploadCommand
- Inherits:
-
OrganizationCommand
- Object
- Command
- OrganizationCommand
- Decidim::Voca::Organization::UpdateFileUploadCommand
- Defined in:
- app/commands/decidim/voca/organization/update_file_upload_command.rb
Instance Attribute Summary collapse
-
#file_upload_settings ⇒ Object
readonly
Returns the value of attribute file_upload_settings.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(file_upload_settings) ⇒ UpdateFileUploadCommand
constructor
A new instance of UpdateFileUploadCommand.
Methods inherited from OrganizationCommand
#command_name, command_name, #organization
Constructor Details
#initialize(file_upload_settings) ⇒ UpdateFileUploadCommand
Returns a new instance of UpdateFileUploadCommand.
6 7 8 9 10 |
# File 'app/commands/decidim/voca/organization/update_file_upload_command.rb', line 6 def initialize(file_upload_settings) @file_upload_settings = with_defaults( file_upload_settings.to_h.with_indifferent_access ) end |
Instance Attribute Details
#file_upload_settings ⇒ Object (readonly)
Returns the value of attribute file_upload_settings.
5 6 7 |
# File 'app/commands/decidim/voca/organization/update_file_upload_command.rb', line 5 def file_upload_settings @file_upload_settings end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'app/commands/decidim/voca/organization/update_file_upload_command.rb', line 12 def call organization.update!( file_upload_settings: file_upload_settings ) broadcast(:ok) rescue e Rails.logger.error(e) broadcast(:fail) end |