In my rails application, I have Companies (which have professional needs) and Public users (which have personnal needs) of my app.
Both roles have their attributes: username, location,... for Public users, and Address, phone, fax, professionnal IDs,... for Companies.
In the other hand, they both share some attributes, like email and password (more specifically authentication information).
How do I can organize this in Rails? What are best practices? Best nomenclature for models?
I'm a bit lost. Do I have to:
- put everything in the same model (called User) ??? Seems like having to manage a mess
- Or to separate models (Company and Public) and link them to User model for shared attributes ??? Kind of extending models
If some of you already were in the same situation (an app that has public and pro use), can you tell me (us) how you did?
Thanks in advance.