Welcome to mirror list, hosted at ThFree Co, Russian Federation.

accepts_pending_invitations.rb « concerns « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1723058c2171b53e75b5d6b42a1d34ddd9904c43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module AcceptsPendingInvitations
  extend ActiveSupport::Concern

  def accept_pending_invitations(user: resource)
    return unless user.active_for_authentication?

    if user.pending_invitations.load.any?
      user.accept_pending_invitations!
      after_pending_invitations_hook
    end
  end

  def after_pending_invitations_hook
    # no-op
  end
end