I’ve been reading up on a bit of STI Inheritence examples for Rails,
While it looks like it would suit my needs (User role/types inheriting from a base class of user). It seems like it doesn’t handle a user having multiple roles too well. Particularly because it relies on a type field in the database.
Is there a quick and easy work around to this?
I’m not sure if STI is the right solution in a user role/user scenario – I don’t think of User roles/types as a specific form of user. I would have the following schema:
Another way of doing this would be to use
has_and_belongs_to_many. You might also want to check out the restful_authentication plugin.