This is more of a theoretical question I suppose - I’m looking for what
consensus is for the “correct” approach in Rails/MVC.
I have a standard security model where a User can have many Roles. There
a User model, a Role model, and in the db, a linking table, etc. Each
has a name as well as a category (say, name=“waiter”,
worker”, for example).
I can check to see of a user has a particular role by doing something
the lines of
There is probably a shorter way of doing this, but the point is this:
Would it be “correct” in the Rails/MVC world to add a method to the User
model so that you could do
(with a better name, of course
Any downside to taking this approach? Is there a “better” one that I