Class: Decidim::Calendar::Admin::CreateExternalEvent
- Inherits:
-
Rectify::Command
- Object
- Rectify::Command
- Decidim::Calendar::Admin::CreateExternalEvent
- Defined in:
- app/commands/decidim/calendar/admin/create_external_event.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(form) ⇒ CreateExternalEvent
constructor
A new instance of CreateExternalEvent.
Constructor Details
#initialize(form) ⇒ CreateExternalEvent
Returns a new instance of CreateExternalEvent.
7 8 9 |
# File 'app/commands/decidim/calendar/admin/create_external_event.rb', line 7 def initialize(form) @form = form end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/commands/decidim/calendar/admin/create_external_event.rb', line 11 def call return broadcast(:invalid) if form.invalid? transaction do create_event end broadcast(:ok, @event) end |