Class: Decidim::DecidimAwesome::Admin::CreateProposalCustomField
- Inherits:
-
Command
- Object
- Command
- Command
- Decidim::DecidimAwesome::Admin::CreateProposalCustomField
- Includes:
- NeedsConstraintHelpers
- Defined in:
- app/commands/decidim/decidim_awesome/admin/create_proposal_custom_field.rb
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(organization, config_var = :proposal_custom_fields) ⇒ CreateProposalCustomField
constructor
Public: Initializes the command.
Constructor Details
#initialize(organization, config_var = :proposal_custom_fields) ⇒ CreateProposalCustomField
Public: Initializes the command.
11 12 13 14 |
# File 'app/commands/decidim/decidim_awesome/admin/create_proposal_custom_field.rb', line 11 def initialize(organization, config_var = :proposal_custom_fields) @organization = organization @config_var = config_var end |
Instance Method Details
#call ⇒ Object
Executes the command. Broadcasts these events:
-
:ok when everything is valid.
-
:invalid if we couldn’t proceed.
Returns nothing.
22 23 24 25 26 27 28 29 30 |
# File 'app/commands/decidim/decidim_awesome/admin/create_proposal_custom_field.rb', line 22 def call create_hash_config!(default_definition) create_constraint_never! broadcast(:ok, ident) rescue StandardError => e broadcast(:invalid, e.) end |