Class: Decidim::Debates::CreateDebate
- Inherits:
-
Commands::CreateResource
- Object
- Commands::CreateResource
- Decidim::Debates::CreateDebate
- Includes:
- MultipleAttachmentsMethods
- Defined in:
- app/commands/decidim/debates/create_debate.rb
Overview
This command is executed when the user creates a Debate from the public views.
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/commands/decidim/debates/create_debate.rb', line 12 def call return broadcast(:invalid) if invalid? if return broadcast(:invalid) if end perform! broadcast(:ok, resource) rescue ActiveRecord::RecordInvalid add_file_attribute_errors! broadcast(:invalid) rescue Decidim::Commands::HookError broadcast(:invalid) end |