
Finder through multiple associations of the same class produces an error
Reported by Jon Sarley | June 4th, 2009 @ 11:57 PM
When the SQL is generated the tables aren't aliased so the table name is ambiguous.
Comments and changes to this ticket
-
Dan Kubb (dkubb) June 16th, 2009 @ 03:40 AM
- Assigned user set to Dan Kubb (dkubb)
- State changed from unconfirmed to accepted
- Milestone set to 0.10.0
-
Dan Kubb (dkubb) October 4th, 2009 @ 09:33 PM
- Milestone changed from 0.10.0 to 0.10.2
[project:id#20609 not-tagged:"0.10.0" milestone:id#51895 bulk edit command]
-
Robert Sköld January 27th, 2010 @ 07:36 AM
- Tag changed from association, associations, finder, finders to ambiguous, association, associations, finder, finders
I'm having the same problem (example at https://gist.github.com/5419e4442a165f8e3ff9).
Is there any workaround for this?
-
Robert Sköld January 27th, 2010 @ 11:17 AM
I tested some more, it works when i remove one of the inner joins, https://gist.github.com/5419e4442a165f8e3ff9#file_tested%20queries
Is the removed one really necessary?
-
Robert Sköld January 27th, 2010 @ 01:30 PM
Allright, so I've 'found' a workaround, which is far from perfect as it's not writable, only readable, which is why I didn't make a simple override. http://gist.github.com/288098
-
Robert Sköld January 28th, 2010 @ 05:24 AM
Ok, so after some more tinkering I've made another workaround, it's a total hack but at least it keeps the API as it should be and it seems to work in my tests at least :)
-
Dan Kubb (dkubb) February 1st, 2010 @ 04:33 PM
- Milestone changed from 0.10.2 to 1.0.0
-
-
-
Dan Kubb (dkubb) February 2nd, 2010 @ 02:47 AM
- State changed from accepted to confirmed
-
snej May 13th, 2010 @ 12:51 PM
I'm running into the same issue, but with a different query. Unfortunately applying the above patch (atop 0.10.2) doesn't help.
I'll try to reduce my code to a simple test case. Shall I post it here, or file a new bug report?
-
-
Piotr Solnica (solnic) March 24th, 2011 @ 06:57 AM
- State changed from confirmed to resolved
- Milestone order changed from 0 to 0
This is fixed in latest DM 1.1.0
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Referenced by
-
1269 "ambiguous column name: id" querying to-many relation from table to itself I've got a different case of the bug reported in ticket #...
-
1269 "ambiguous column name: id" querying to-many relation from table to itself I've got a different case of the bug reported in ticket #...