|
I have a table Attachments that has two join keys (that are not the PK) that reference into another table AttachmentCategory. But in that table it has both categories and subcategories. So Attachments.cat_id contains value of id from the Attachment_category.id column, and Attachments.subcat_id is the id that matches AttachmentCategory.id as well. The AttachmentCategory table has both categories and subcategories. I tried making two associations in the Attachment.cfc model. The AttachmentCategory table has id, catType, category. In my Attachments.cfc controller I added: But it appears you can only do one include, the last one. I also tried combining them in one include... But that throws an error: Any help would be appreciated. |
Replies: 2 comments
|
You currently cannot join the same table twice because wheels doesn't distinguish between the same table in two different models. There reaches a point where one pushes the wheels ORM to its limit, and it becomes time to resort to some SQL. It's a known limitation. |
|
Can you change your database schema?
|
You currently cannot join the same table twice because wheels doesn't distinguish between the same table in two different models. There reaches a point where one pushes the wheels ORM to its limit, and it becomes time to resort to some SQL.
It's a known limitation.
#1217