User Invitations
User registration is invite-based, powered by Devise Invitable.
How It Works
- An existing user (with invitation privileges) sends an invite via email
- The invitee receives an email with a registration link
- On accepting the invitation, the new user account is created
Auto-Populated Fields
The custom Users::InvitationsController overrides Devise’s invite_resource method to auto-populate the invitee’s record with:
target_language– copied from the inviterfluent_language– copied from the invitercommunity_id– copied from the inviter
This ensures new users are placed in the same community and language pair as the person who invited them.
Database Fields
Invitation tracking columns on the users table:
invitation_token– unique token for the invitation linkinvitation_sent_at,invitation_accepted_at– timestampsinvitations_count– number of invitations sent by this userinvitation_limit– max invitations this user can sendinvited_by_id,invited_by_type– polymorphic reference to the inviter
Routes
Managed via Devise with custom controller:
devise_for :users, controllers: { invitations: "users/invitations" }