Class: Decidim::Conferences::Admin::ConfirmConferenceRegistration
- Inherits:
-
Decidim::Command
- Object
- Decidim::Command
- Decidim::Conferences::Admin::ConfirmConferenceRegistration
- Defined in:
- 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.
Constructor Details
#initialize(conference_registration, current_user) ⇒ ConfirmConferenceRegistration
Initializes a JoinConference Command.
conference_registration - The registration to be confirmed
11 12 13 14 |
# File '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 |
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 '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 |