Rails: Polymorphic User Table a good idea with AuthLogic?
- by sscirrus
Hi everyone,
I have a system where I need to login three user types: customers, companies, and vendors from one login form on the home page.
I have created one User table that works according to AuthLogic's example app at http://github.com/binarylogic/authlogic_example. I have added a field called "User Type" that currently contains either 'Customer', 'Company', or 'Vendor'.
Note: each user type contains many disparate fields so I'm not sure if Single Table Inheritance is the best way to go (would welcome corrections if this conclusion is invalid).
Is this a polymorphic association where each of the three types is 'tagged' with a User record? How should my models look so I have the right relationships between my User table and my user types Customer, Company, Vendor?
Thanks very much!