I have a User and Company model. There are three possible roles that a user can have: Owner, Agent or End-User. Agents and End-Users belong to companies, which in turn belong to Owners. How would you go about making the association between these models?
Would a habtm association be useful here? I.e Users can have and belong to many companies. The only problem is that a user should only belong to a single company. However, owners should be able to own many companies.
Also, I'd need all the users belonging to the company to be removed if the company is destroyed. Or... if the owner is destroyed, all companies (and hence users belonging to those companies) should also be deleted. I'm not sure if a habtm association can do this.