Thanks very much for the hint - I didn't think of that problem. > - you could create a polymorphic building with an interface for > headquarter and branch
I think it's a good idea to differentiate headquarters and building using another model (did I get this right?) Would you suggest - assuming that building belongs_to company in a polymorphic way - to create a table for headquarters? As it's just a unique property among the set of buildings belonging to one company maybe it's good to use STI and let Headquarter inherit from Building. In the database this would result in a kind of flag (the type column) as well, but maybe it would cause more readable code and prevent some "if building.headquarter" patterns. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

