2 models with multiple relationships

I am in the middle of building YARELS (Yet Another Real Estate Listing
Site), and here is one of my issues with model relationships.

I have to core models and DB tables:


Here are the relationships I need to express:

A user can have many properties that he owns (he is the seller)
A user can have many properties on his favorites list (he is a
A user can have many properties that he manages (he is a listing
* A listing manager actually has control over counties
so if a property shows up in that county, it is his.

Property has_one seller
Property has_many watchers :through => :saved_property
Property has_one listing manager

I am just wanting to make sure that none of the lovely Rails features
override each other. I already made a join model for SavedProperty, and
the relationship with the listing manager could be joined through a
table that lists the counties.

My main question is: could I be doing something better to make these
relatioships seemless? Should I use single-table-inheritance with the
User in order to give users specific roles (even though sellers and
managers need to have all the same priviliges as buyers, so it could end
up conflicting that way too).

Thanks for all your help.

Timothy J.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs