Scenario: I have a users table in my application. I also have two subclasses of users, lets say contributors and viewers. Each user group must have an entirely different set of attributes but they both share certain user properties (login, password, name).
What is the best way to implement this using Ruby on Rails?
- I think single table inheritance would leave me with too many null fields.
- I think linking three tables (users, viewers, contributors) would work fine, but then when wanting to edit any information i have to do:
@user.viewer
, while i would love to be able to just do@viewer
.
Any ideas of the best solution?