Class: Decidim::Meetings::Admin::ValidateRegistrationCode
- Inherits:
-
Command
- Object
- Command
- Decidim::Meetings::Admin::ValidateRegistrationCode
- Defined in:
- app/commands/decidim/meetings/admin/validate_registration_code.rb
Overview
This command is executed when the admin validates a registration code in the admin panel.
Instance Method Summary collapse
-
#call ⇒ Object
Validates the registration code the meeting if valid.
-
#initialize(form, meeting) ⇒ ValidateRegistrationCode
constructor
Initializes a ValidateRegistrationCode Command.
Constructor Details
#initialize(form, meeting) ⇒ ValidateRegistrationCode
Initializes a ValidateRegistrationCode Command.
form - The form from which to get the data. meeting - The current instance of the meeting to be updated.
12 13 14 15 |
# File 'app/commands/decidim/meetings/admin/validate_registration_code.rb', line 12 def initialize(form, meeting) @form = form @meeting = meeting end |
Instance Method Details
#call ⇒ Object
Validates the registration code the meeting if valid.
Broadcasts :ok if successful, :invalid otherwise.
20 21 22 23 24 25 26 27 |
# File 'app/commands/decidim/meetings/admin/validate_registration_code.rb', line 20 def call return broadcast(:invalid) if form.invalid? validate_registration_code send_notification broadcast(:ok) end |