Files
ubicloud/model/project_invitation.rb
Enes Cakir 0590b812b3 Persist project invitation if account doesn't exists
When a user is invited to a project, we associate them to it if they
already have an account. If they don't, we send an invitation email.
However, this approach often leads to a poor user experience, as the
admin must resend the invitation once the user creates an account. To
address this, I've implemented a fix that persists the invitation and
automatically associates the user to the project upon account creation.

I considered creating a temporary account in the existing accounts table
with a different status ID, but this would require extensive Rodauth
overrides. Therefore, I chose not to include non-existing users in the
accounts table, which serves as the backbone of our authentication
system.

Another alternative could involve not automatically associating the user
to the project upon account creation. Instead, users could explicitly
accept the invitation post-account creation. However, I found no
compelling reason to avoid automatic project-user association.
2024-09-10 19:21:45 +03:00

10 lines
170 B
Ruby

# frozen_string_literal: true
require_relative "../model"
class ProjectInvitation < Sequel::Model
many_to_one :project
end
ProjectInvitation.unrestrict_primary_key