For a current project of mine, I am trying to first design the database schema for the application. However, I am unable to decide whether or not to use Single Table Inheritence on the User model for my application.
A User can be an: Owner, Resident, or Admin, and since they share same attributes with different functions, I think STI applies here. Am I going in the right direction with this? If not, please suggest better alternatives. Is polymorphic association a fit here? Note that, authentication and access control is intended on Users, as normally would.
Regards,
I believe you are correct — STI would be appropriate in this case. And since authentication is intended on Users, it would give you the simpler solution. Also, since they share attributes as well, I would say STI over polymorphic association — the only thing that differs is the type of the user, which that handles.