Module: AcceptsPendingInvitations

Extended by:
ActiveSupport::Concern
Included in:
ConfirmationsController, RegistrationsController
Defined in:
app/controllers/concerns/accepts_pending_invitations.rb

Instance Method Summary collapse

Instance Method Details

#accept_pending_invitationsObject


6
7
8
9
10
11
12
13
14
# File 'app/controllers/concerns/accepts_pending_invitations.rb', line 6

def accept_pending_invitations
  return unless resource.active_for_authentication?

  if resource.pending_invitations.load.any?
    resource.accept_pending_invitations!
    clear_stored_location_for_resource
    after_pending_invitations_hook
  end
end

#after_pending_invitations_hookObject


16
17
18
# File 'app/controllers/concerns/accepts_pending_invitations.rb', line 16

def after_pending_invitations_hook
  # no-op
end

#clear_stored_location_for_resourceObject


20
21
22
23
24
# File 'app/controllers/concerns/accepts_pending_invitations.rb', line 20

def clear_stored_location_for_resource
  session_key = stored_location_key_for(resource)

  session.delete(session_key)
end