Great! it worked for my need! I didn't realize that that key was the one used under the hood for normal joining. I'll keep it mind. I guess I don't really understand the difference between just "conditions" and "graph_table_conditions". I guess conditions is more flexible because it's added to the end whereas graph_table_conditions requires that it be a hash or array of two elements?
On Thursday, May 28, 2020 at 8:36:11 PM UTC+3, Jeremy Evans wrote: > > On Thursday, May 28, 2020 at 10:09:55 AM UTC-7, Aryk Grosz wrote: >> >> Is there a way to change the condition so that it is not added to the >> second join, but rather to the first on the "ON" condition? >> > >> I understand that putting it on the second always ensures that the >> condition has the table referenced, but if you are doing something like a >> left_join, it will change the result set. It did with me. >> >> A simple work around is to do: >> >> association_left_join(foo: :bar) instead of >> association_left_join(:foo_bars), but I don't need the intermediary table. >> >> Not a huge deal, but curious if I was missing how to do that when >> defining the association. >> > > Assuming you are just talking about association_join/eager_graph of > many_to_many/one_through_one associations, there is the > :graph_join_table_conditions option (and other options starting with > graph_join_table_). > > 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 view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/9c8ccc38-8c43-4365-a5bb-1c54b11e0a72%40googlegroups.com.
