Class: Decidim::DecidimAwesome::Admin::CreateScopedAdmin
- Includes:
- NeedsConstraintHelpers
- Defined in:
- app/commands/decidim/decidim_awesome/admin/create_scoped_admin.rb
Instance Method Summary collapse
-
#call ⇒ Object
Executes the command.
-
#initialize(organization) ⇒ CreateScopedAdmin
constructor
Public: Initializes the command.
Constructor Details
#initialize(organization) ⇒ CreateScopedAdmin
Public: Initializes the command.
11 12 13 14 |
# File 'app/commands/decidim/decidim_awesome/admin/create_scoped_admin.rb', line 11 def initialize(organization) @organization = organization @config_var = :scoped_admins 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_scoped_admin.rb', line 22 def call create_hash_config!([]) create_constraint_never! broadcast(:ok, ident) rescue StandardError => e broadcast(:invalid, e.) end |