debian-mirror-gitlab/app/controllers/concerns/accepts_pending_invitations.rb
2022-10-11 01:57:18 +05:30

18 lines
389 B
Ruby

# 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