My question is part Rails and part database design pattern:
I've got several classes of users in my system:
My thought is to have a base User class for authentication purposes, and instantiate one of the user classes (subclasses of User?) based on the class of the user.
1) is this a smart design pattern for the database? A 'users' table with authentication information and a 'user_class_id' field that points to a 'user_classes' table, from which the proper subclass is instantiated?
if not, what would be the best way to design this?
2) how would you model this in Ruby on Rails? particularly if the user class is in the User table?
You could use one table for the login information (users), and other tables for the Residents, Sponsors, etc. Now you make a many-to-many relation between residents and users, sponsors and users, etc. This way you can have multiple users for one sponsor. Only if you need this flexibility.