Draft: Add organization associations to User
What does this MR do and why?
Add owner_organization and organizations associations to User.
Add owned_users and users associations to Organization::Organization
How to set up and validate locally
- Run the migrations
- Associate an owner organization for a user by running:
user = User.lastuser.owner_organization_id = 1user.save!user.reload.owner_organization.owned_users
- Add
organization_userand test the associations:organization_user = Organizations::OrganizationUser.new(organization_id: 1, user_id: <user-id>)organization_user.save!Organizations::Organization.find(1).usersUser.find(<user-id>).organizations
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #407837 (closed)