Class: Decidim::Admin::InviteAdmin
- Inherits:
-
Command
- Object
- Command
- Decidim::Admin::InviteAdmin
- Defined in:
- app/commands/decidim/admin/invite_admin.rb
Overview
A command to invite an admin.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(form) ⇒ InviteAdmin
constructor
Public: Initializes the command.
Constructor Details
#initialize(form) ⇒ InviteAdmin
Public: Initializes the command.
form - A form object with the params.
10 11 12 |
# File 'app/commands/decidim/admin/invite_admin.rb', line 10 def initialize(form) @form = form end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'app/commands/decidim/admin/invite_admin.rb', line 14 def call return broadcast(:invalid) if form.invalid? transaction do invite_user log_action end broadcast(:ok) end |