Class: Decidim::Meetings::JoinWaitlist
- Defined in:
- decidim-meetings/app/commands/decidim/meetings/join_waitlist.rb
Overview
This command is executed when the user joins a meeting waitlist.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(meeting, form) ⇒ JoinWaitlist
constructor
A new instance of JoinWaitlist.
Methods inherited from Command
call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events
Constructor Details
#initialize(meeting, form) ⇒ JoinWaitlist
Returns a new instance of JoinWaitlist.
9 10 11 12 |
# File 'decidim-meetings/app/commands/decidim/meetings/join_waitlist.rb', line 9 def initialize(meeting, form) @meeting = meeting @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
14 15 16 17 18 19 20 21 22 23 24 |
# File 'decidim-meetings/app/commands/decidim/meetings/join_waitlist.rb', line 14 def call return broadcast(:invalid) unless can_join_waitlist? return broadcast(:invalid_form) unless form.valid? meeting.with_lock do create_waitlist_entry send_waitlist_notification end broadcast(:ok) end |