-
Notifications
You must be signed in to change notification settings - Fork 212
Default scope where conditions with or in rails 4 and squeel #416
Comments
Just an update on this one. The problem seems to be in the collapse_where method. If i simply comment this monkey patch out, then the test passes. |
Update again. The problem is now reproduced within a spec on a fork of squeel. https://github.com/viewthespace/squeel/commit/5571d4a96eb9d52f9427172acff6685b1692873f As of now i am bit clueless of what the collapse_where method does and how to address the problem. Any advice would be greatly appreciated. Thx! |
@azhi - that looks to be the same issue. I noticed that the issue is resolved if i simply comment out the collapse_where method. Is this monkey patch even needed in rails 4? When I comment out the collapse_where method, the following tests fail:
But at a glance it does not look like the queries produced are invalid even though they do not exactly match expectations.
I self-admittedly do not know what the collapse_where monkey patch does so i may be way off base. thx! |
Hi. We are running into a problem with default scopes with
or
conditions when squeel is required. This problem can be reproduced easily from this project:https://github.com/viewthespace/squeel_default_scope_or_condition_with_joins
I go into detail within the readme but to sum up, a default scope with an or condition and additional where criteria causes queries with joins from a parent to be malformed. The problem occurs without us using any squeel syntax. The project contains a test that demonstrates the problem only occurs with squeel required.
thx!
-karl
The text was updated successfully, but these errors were encountered: