Same Model with different columns Rails

Viewed 1415

I have 2 user roles Developer and Driver. They both are under an User model, but also both have different details such as Developer has hourly_rate, skills, experience, full_name and Driver has cars_he_can_drive, hours_driven, full_name etc.

They have some common columns and some different ones as well. Should there be a separate detail table (develop_details, driver_details) for each of the User? and further, relationships can be made with them.

Else I can have same model with all columns and fetch only the ones required (others will be nil ofcourse).

UPDATE Im using role as and integer in user table and then using enums. I'm using Rails 5 with devise 4.3.0.

3 Answers
Related