Class: Decidim::InviteUserAgain

Inherits:
Rectify::Command
  • Object
show all
Defined in:
decidim-core/app/commands/decidim/invite_user_again.rb

Overview

A command with the business logic to invite an user to an organization.

Instance Method Summary collapse

Constructor Details

#initialize(user, instructions) ⇒ InviteUserAgain

Public: Initializes the command.

user - The user that receives the invitation instructions. instructions - The invitation instructions that is sent to the user.


10
11
12
13
# File 'decidim-core/app/commands/decidim/invite_user_again.rb', line 10

def initialize(user, instructions)
  @user = user
  @instructions = instructions
end

Instance Method Details

#callObject


15
16
17
18
# File 'decidim-core/app/commands/decidim/invite_user_again.rb', line 15

def call
  user.invite!(user.invited_by, invitation_instructions: instructions)
  broadcast(:ok)
end