Hi Jeremy, it seems like it's working, but why is that it essentially 
plugins in the associations twice if you opt in 
for dataset_associations_join?

What if I just want the joins but not the subselect in the where clause?

On Friday, July 28, 2017 at 10:41:49 AM UTC-7, Aryk Grosz wrote:
>
> Ok, will do Jeremy! Thanks for getting this fixed so fast! :)
>
> On Friday, July 28, 2017 at 8:57:28 AM UTC-7, Jeremy Evans wrote:
>>
>> On Thursday, July 27, 2017 at 11:15:32 PM UTC-7, Jeremy Evans wrote:
>>>
>>> On Thursday, July 27, 2017 at 1:46:08 PM UTC-7, Aryk Grosz wrote:
>>>>
>>>> If I have a many_through_many that reuses the same table, it will 
>>>> change the qualifier for the second table when called from an instance, 
>>>> but 
>>>> when used with dataset_associations, it will not, leading to "Not unique 
>>>> table/alias:".
>>>>
>>>> Looking at the plugin, seems like the problem could be here:
>>>>
>>>>
>>>> https://github.com/jeremyevans/sequel/blob/master/lib/sequel/plugins/dataset_associations.rb#L111
>>>>
>>>
>>>> Shouldn't the e[:table] be aliased if it gets called a second time?
>>>>
>>>
>>> Thanks for reporting this.  I do think this is a limitation that should 
>>> be fixed.  Can you try the diff at https://pastebin.com/raw/8YKVfG9N 
>>> and let me know if it fixes the problem for you?  It works in my tests 
>>> (both plugin and integration tests, as well as with a real app I have), but 
>>> it would definitely be best to get additional testing.  The reason it isn't 
>>> a problem in the other cases is that for regular and eager loading, 
>>> reverse_edges is used and that contains the alias, and eager_graph does the 
>>> aliasing internally, so edges didn't need to do alias handling 
>>> (dataset_associations uses edges).
>>>
>>
>> I've committed this change with tests.  Please try out the master branch 
>> and let me know if this doesn't fix your issue or you notice additional 
>> issues: 
>> https://github.com/jeremyevans/sequel/commit/48a4d10109261c72129f6e313daa911407108a80
>>
>> Thanks,
>> Jeremy
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to