Class: Decidim::Admin::ProcessUserGroupVerificationCsv
- Includes:
- CustomImport
- Defined in:
- decidim-admin/app/commands/decidim/admin/process_user_group_verification_csv.rb
Overview
A command with all the business logic when processing the CSV to verify user groups.
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(form) ⇒ ProcessUserGroupVerificationCsv
constructor
Public: Initializes the command.
Methods inherited from Command
call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events
Constructor Details
#initialize(form) ⇒ ProcessUserGroupVerificationCsv
Public: Initializes the command.
form - the form object containing the uploaded file
15 16 17 |
# File 'decidim-admin/app/commands/decidim/admin/process_user_group_verification_csv.rb', line 15 def initialize(form) @form = form end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Decidim::Command
Instance Method Details
#call ⇒ Object
Executes the command. Broadcasts these events:
-
:ok when everything is valid.
-
:invalid if the form was not valid and we could not proceed.
Returns nothing.
25 26 27 28 29 30 |
# File 'decidim-admin/app/commands/decidim/admin/process_user_group_verification_csv.rb', line 25 def call return broadcast(:invalid) unless @form.valid? process_csv broadcast(:ok) end |