I have a superuser which belongs to several tenants. Data such as first_name and last_name are kept in a separate members table as recommended. I understand your explanations in https://github.com/dsaronin/milia#inviting-additional-usermembers as follows:
- I need one
user record for this superuser
- I need entries in
tenants_users to define the membership of this user to the according tenants
- And: I need one
member record for this user for each tenant this user can access (this is because the members table is tenanted; only the users table isn't tenanted)
However:
- your docs say there needs to be a
has_one :member relation on the user (and not a has_many).
- It doesn't feel clean to replicate the members data (such as
first_name and last_name) n times if the user belongs to n companies.
What is the recommended way to do it with milia?
I have a superuser which belongs to several tenants. Data such as
first_nameandlast_nameare kept in a separatememberstable as recommended. I understand your explanations in https://github.com/dsaronin/milia#inviting-additional-usermembers as follows:userrecord for this superusertenants_usersto define the membership of this user to the according tenantsmemberrecord for this user for each tenant this user can access (this is because thememberstable is tenanted; only theuserstable isn't tenanted)However:
has_one :memberrelation on theuser(and not ahas_many).first_nameandlast_name)ntimes if the user belongs toncompanies.What is the recommended way to do it with milia?