Sha256: f8213d6a45328891797e10a705f128925e9dbf425224f120e71da8c2754b4269

Contents?: true

Size: 492 Bytes

Versions: 87

Compression:

Stored size: 492 Bytes

Contents

module InvitationsHelper
  def handle_outstanding_invitation
    # was this user registering to claim an invitation?
    if session[:invitation_uuid].present?

      # try to find the invitation, if it still exists.
      invitation = Invitation.find_by_uuid(session[:invitation_uuid])

      # if the invitation was found, claim it for this user.
      invitation&.accept_for(current_user)

      # remove the uuid from the session.
      session.delete(:invitation_uuid)

    end
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
bullet_train-1.0.98 app/helpers/invitations_helper.rb
bullet_train-1.0.97 app/helpers/invitations_helper.rb
bullet_train-1.0.96 app/helpers/invitations_helper.rb
bullet_train-1.0.95 app/helpers/invitations_helper.rb
bullet_train-1.0.93 app/helpers/invitations_helper.rb
bullet_train-1.0.92 app/helpers/invitations_helper.rb
bullet_train-1.0.90 app/helpers/invitations_helper.rb
bullet_train-1.0.89 app/helpers/invitations_helper.rb
bullet_train-1.0.88 app/helpers/invitations_helper.rb
bullet_train-1.0.87 app/helpers/invitations_helper.rb
bullet_train-1.0.86 app/helpers/invitations_helper.rb
bullet_train-1.0.85 app/helpers/invitations_helper.rb
bullet_train-1.0.83 app/helpers/invitations_helper.rb
bullet_train-1.0.81 app/helpers/invitations_helper.rb
bullet_train-1.0.79 app/helpers/invitations_helper.rb
bullet_train-1.0.76 app/helpers/invitations_helper.rb
bullet_train-1.0.75 app/helpers/invitations_helper.rb
bullet_train-1.0.74 app/helpers/invitations_helper.rb
bullet_train-1.0.72 app/helpers/invitations_helper.rb
bullet_train-1.0.71 app/helpers/invitations_helper.rb