I've seemed to have gotten myself into a bit of a pickle. I'm trying to write a way to destroy users, but still retain their content.
Currently in my app, a company has many users, and users belongs to one company. A company can make a user inactive if they need to, but I'd also like for the company to be able to remove users from their account in cases of termination, etc.
I was going to simply, on destroy, set the foreign company_id key to nil in the user's table. However, by doing this, the company would lose this old user's work, something that can't happen, as information is populated from doing queries on the company_id.
Has anyone thought of a nice little way of getting around this with a similar DB design? Or will I have to go back to square one to figure out a way to do this more effectively.
Thanks
This is really more of an interface issue than a data model issue. To be sure, you shouldn't actually delete/destroy the users if you need to retain their information. But if you need a way of removing users apart from just making them inactive, you could add another option for a 'terminated' status. Then it just depends on how and where you display these terminated users in the front end (or maybe you just never display them).