Sha256: 4922566408fd7603068c12873468dadcfd287138530f490e89fa642128af8836

Contents?: true

Size: 602 Bytes

Versions: 35

Compression:

Stored size: 602 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # A command with the business logic to invite an user to an organization.
  class InviteUserAgain < Rectify::Command
    # Public: Initializes the command.
    #
    # form - A form object with the params.
    def initialize(user, instructions)
      @user = user
      @instructions = instructions
    end

    def call
      return broadcast(:invalid) unless user&.invited_to_sign_up?

      user.invite!(user.invited_by, invitation_instructions: instructions)

      broadcast(:ok)
    end

    private

    attr_reader :user, :instructions
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
decidim-core-0.21.0 app/commands/decidim/invite_user_again.rb
decidim-core-0.20.1 app/commands/decidim/invite_user_again.rb
decidim-core-0.20.0 app/commands/decidim/invite_user_again.rb
decidim-core-0.19.1 app/commands/decidim/invite_user_again.rb
decidim-core-0.18.1 app/commands/decidim/invite_user_again.rb
decidim-core-0.19.0 app/commands/decidim/invite_user_again.rb
decidim-core-0.17.2 app/commands/decidim/invite_user_again.rb
decidim-core-0.18.0 app/commands/decidim/invite_user_again.rb
decidim-core-0.17.1 app/commands/decidim/invite_user_again.rb
decidim-core-0.16.1 app/commands/decidim/invite_user_again.rb
decidim-core-0.17.0 app/commands/decidim/invite_user_again.rb
decidim-core-0.16.0 app/commands/decidim/invite_user_again.rb
decidim-core-0.15.2 app/commands/decidim/invite_user_again.rb
decidim-core-0.15.1 app/commands/decidim/invite_user_again.rb
decidim-core-0.15.0 app/commands/decidim/invite_user_again.rb
decidim-core-0.14.4 app/commands/decidim/invite_user_again.rb
decidim-core-0.14.3 app/commands/decidim/invite_user_again.rb
decidim-core-0.14.2 app/commands/decidim/invite_user_again.rb
decidim-core-0.14.1 app/commands/decidim/invite_user_again.rb
decidim-core-0.13.1 app/commands/decidim/invite_user_again.rb