Class: Decidim::Conferences::Admin::ConfirmConferenceRegistration
- Inherits:
-
Decidim::Command
- Object
- Decidim::Command
- Decidim::Conferences::Admin::ConfirmConferenceRegistration
- Defined in:
- decidim-conferences/app/commands/decidim/conferences/admin/confirm_conference_registration.rb
Overview
This command is executed when the user joins a conference.
Instance Method Summary collapse
-
#call ⇒ Object
Creates a conference registration if the conference has registrations enabled and there are available slots.
-
#initialize(conference_registration, current_user) ⇒ ConfirmConferenceRegistration
constructor
Initializes a JoinConference Command.
Methods inherited from Decidim::Command
call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events
Constructor Details
#initialize(conference_registration, current_user) ⇒ ConfirmConferenceRegistration
Initializes a JoinConference Command.
conference_registration - The registration to be confirmed
11 12 13 14 |
# File 'decidim-conferences/app/commands/decidim/conferences/admin/confirm_conference_registration.rb', line 11 def initialize(conference_registration, current_user) @conference_registration = conference_registration @current_user = current_user end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Decidim::Command
Instance Method Details
#call ⇒ Object
Creates a conference registration if the conference has registrations enabled and there are available slots.
Broadcasts :ok if successful, :invalid otherwise.
20 21 22 23 24 25 26 27 28 29 |
# File 'decidim-conferences/app/commands/decidim/conferences/admin/confirm_conference_registration.rb', line 20 def call return broadcast(:invalid) unless can_join_conference? @conference_registration.with_lock do confirm_registration send_email_confirmation send_notification_confirmation end broadcast(:ok) end |