Re: Modeling complex associations

Ar Chron
Mon, 19 Jan 2009 14:44:47 -0000

> I think it''s a good idea to differentiate headquarters and
building
> using another model (did I get this right?)

That depends... is there something substantively different about a
building that is designated as the headquarters? I.e., are you
maintaining additional data that is specific to a "headquarters"?

If I think about bigger office buildings, there can be several companies
that lease individual floors of a building (sometimes sections within
floors). Any of those areas might be the individual company''s
headquarters, while it''s all the same physical building.

So if companies can have space in multiple buildings, and a single
building can house space for multiple companies, you need a join table
that represents company-building combinations (officespaces?), and it
seems that this join entity is what you would need to designate as a
headquarters or not.
--
Posted via http://www.ruby-forum.com/.