Class: Decidim::Debates::Admin::CreateDebate
- Inherits:
-
Commands::CreateResource
- Object
- Command
- Commands::CreateResource
- Decidim::Debates::Admin::CreateDebate
- Includes:
- MultipleAttachmentsMethods
- Defined in:
- decidim-debates/app/commands/decidim/debates/admin/create_debate.rb
Overview
This command is executed when the user creates a Debate from the admin panel.
Instance Method Summary collapse
Methods inherited from Commands::CreateResource
Methods inherited from Command
call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events
Constructor Details
This class inherits a constructor from Decidim::Commands::CreateResource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Decidim::Command
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'decidim-debates/app/commands/decidim/debates/admin/create_debate.rb', line 13 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 |