Joining a table twice in a search
Hi there,
I'm using your amazing ransack gem inside my app, but I'm experiencing a weird behavior. I recently began to upgrade to rails 4.1.16 from 4.0.3 (and later to 4.2 and 5). (Same behavior from rails 4.1.16 to rails 5.1.4)
Unfortunately there is a regression for me, here is the gist I made for you, accroding to your contribution guide : https://gist.github.com/foxpowa/7e84f7a43d1677af5652bd037aa4b2fd
Basically, my query implies to join the same table (parameters) twice. The last join (parameter_definitions) is a subset selection for previously joined parameters data.
Previously, ransack was generating the query in the assert, with the alias 'parameters_parameter_groups'. But now, as you guess, it tries to join the 'parameter_definition' on the first 'parameters' join.
Is there something I missed ?
My apologies if there already is some posts about this issue somewhere in web, I was unable to find it.
Let me know if you want other informations.
Thank you @foxpowa for the gist, will look at this when I have time.
Gist is deleted, closing.