tomichj / invitation

A Rails gem that can send 'scoped' invitations
MIT License
75 stars 28 forks source link

Does this allow multiple invites for a given resource? #21

Closed krue-doug closed 6 years ago

krue-doug commented 6 years ago

For example, if a person receives an invite from many users then the person can choose which one to accept. Would any of the other invites be invalid in favor of the newest one? devise_invitable creates a user after an invite is created, is this the case for invitation as well?

tomichj commented 6 years ago

There are several questions here, I'll try to unpack them and answer them clearly, but feel free to follow up.

Invitation does not create a user when the invite is created. An Invitation instance is created when you issue an invitation. The Invitation records the email address of the invitee, the sender, the resource the invitation is for, etc.

When the invitee accepts the invitation, your user registration controller creates the user instance. Your user registration controller should include Invitation::UserRegistration to assist in adding them to the resource they were invited to.

Issuing multiple invitations to a resource does not invalidate any of the previous invitations.

This project needs additional documentation. I'll try to add some over time.