search for: has_role_category

Displaying 1 result from an estimated 1 matches for "has_role_category".

2005 Dec 16
3
Adding methods to models
...g the lines of @session[:user].roles.include?(Role.find_by_category("restaurant worker")) 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 @session[:user].has_role_category?("restaurant worker") (with a better name, of course :-) Any downside to taking this approach? Is there a "better" one that I should consider? Thoughts? TIA, Keith