I have this model:
User
belongs_to :group
has_many :email_addresses
has_many :phone_numbers
has_many :urls
The email_address, phone_number and url objects are subclasses of
entry (a single table inheritance object) stored in the entries table.
When I try and use User.find with and :include =>
[:team, :phone_numbers, :email_addresses, :urls]
I get the following error: "unique table/alias:
''entries'':..."
Am I missing something? If not, would it work to include :entries
instead and hope that AR will use cached records to fill in
phone_numbers, email_addresses and urls?
My grasp of the issue is that AR is generating 3 joins for the
entries table. When in fact a single join is all that is needed for a
single table inheritance relationship. Either that or some SQL table
name alias for each relationship. Right?
--
Lon Baker
Speedymac LLC
http://www.speedymac.com
AIM: spdemac
Skype: spdemac