Remove user default organization callbacks
We should rework this callback.
# app/models/user.rb
def update_default_organization_user
Organizations::OrganizationUser.update_default_organization_record_for(id, user_is_admin: admin?)
end
What it does today is couples being an admin (user.root == true) with being an Organization Owner. When these two become decoupled bad things happen.
The problem is that the code directly references the Default Organization. This isn't necessary now and means the code is not Cells compatible because the Default Organization will only exist on the Legacy Cell.
We can replace the Default Organization reference with the user's Home Organization (user.organization).
Edited by Alex Pooley