Lets say there is a activerecord class called user, which is representative of user table of database.
But I have different type of users which have
- special functions
- special variables
- custom relations (Employer has_many companies, Employee belongs_to company :)
But also these users have a lot of functionality in common. So what I want to do is create classes for each different type of user then inherit them from user class.
- User < ActiveRecord::Base
- Employer < User
- Employee < User
- Customer < User
What is the best way of doing something like that?
Thanks