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.last
user.owner_organization_id = 1
user.save!
user.reload.owner_organization.owned_users
- Add
organization_user
and test the associations:organization_user = Organizations::OrganizationUser.new(organization_id: 1, user_id: <user-id>)
organization_user.save!
Organizations::Organization.find(1).users
User.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)