-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with Rails 4.2 #2
Comments
Here is a simplified patch: |
Hello, Remi! Ill release your patch as soon as I get back to the keyboard (in a few days). Thanks for figuring it out 👍 |
Fix is at #4 |
Released with v3.1.2. Thank you ❤️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rails 4.2 changed some internals of ActiveRecord query-building, so your code for or-conditions doesn't work. More specifically,
or_query
method inmanager.rb
fails to build a valid query.The problem is that setting
where_values
does not affectbind_values
, and thelatter doen't fill all of the
?
slots in the resulting query.I was able to work around the issue by applying the following patch:
https://gist.github.com/remigijusj/65ce558215292b85948b
However it doesn't quite work with
and
-joinedor
conditions (seefilter_by_params!
)I could find little info about the change in ActiveRecord. Some links here:
http://qiita.com/joker1007/items/5c851526e73b3bc0273a
http://stackoverflow.com/questions/27627390/or-operator-in-where-clause-with-arel-in-rails-4-2
The text was updated successfully, but these errors were encountered: