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). 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.
