Sha256: 5a69b20665da7beeaf1c412ed6e31a44e8d71cde7f151a2da83897a5a46a75d4

Contents?: true

Size: 638 Bytes

Versions: 25

Compression:

Stored size: 638 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # A command with the business logic to invite an user to an organization.
  class InviteUserAgain < Decidim::Command
    # Public: Initializes the command.
    #
    # user         - The user that receives the invitation instructions.
    # instructions - The invitation instructions that is sent to the user.
    def initialize(user, instructions)
      @user = user
      @instructions = instructions
    end

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

    private

    attr_reader :user, :instructions
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/commands/decidim/invite_user_again.rb
decidim-core-0.28.4 app/commands/decidim/invite_user_again.rb
decidim-core-0.27.9 app/commands/decidim/invite_user_again.rb
decidim-core-0.29.0 app/commands/decidim/invite_user_again.rb
decidim-core-0.28.3 app/commands/decidim/invite_user_again.rb
decidim-core-0.27.8 app/commands/decidim/invite_user_again.rb
decidim-core-0.29.0.rc4 app/commands/decidim/invite_user_again.rb
decidim-core-0.29.0.rc3 app/commands/decidim/invite_user_again.rb
decidim-core-0.29.0.rc2 app/commands/decidim/invite_user_again.rb
decidim-core-0.29.0.rc1 app/commands/decidim/invite_user_again.rb
decidim-core-0.28.2 app/commands/decidim/invite_user_again.rb
decidim-core-0.27.7 app/commands/decidim/invite_user_again.rb
decidim-core-0.28.1 app/commands/decidim/invite_user_again.rb
decidim-core-0.27.6 app/commands/decidim/invite_user_again.rb
decidim-core-0.28.0 app/commands/decidim/invite_user_again.rb
decidim-core-0.27.5 app/commands/decidim/invite_user_again.rb
decidim-core-0.28.0.rc5 app/commands/decidim/invite_user_again.rb
decidim-core-0.28.0.rc4 app/commands/decidim/invite_user_again.rb
decidim-core-0.27.4 app/commands/decidim/invite_user_again.rb
decidim-core-0.27.3 app/commands/decidim/invite_user_again.rb