-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
[472] Allow arrays to be received for custom ransacker #486
Conversation
Thanks, @ideanl. The test suite is not passing. Did running the Ransack specs work for you with your PR? The first step to take would be to write a test for the problem that works with Arel 5 and that fails with Arel 6 or Arel master. This would allow others to replicate the problem and then work efficiently to solve it. |
Ok, I've updated the PR with a test that passes with Arel 5, but fails in Arel 6, and I've made all the tests pass by revising the code I added. |
[472] Allow arrays to be received for ransacker with Rails 4.2/Arel 6
Thanks @ideanl, this improves compatibility with Rails 4.2 (Arel 6.0). |
Would you like to update the change log? It still does not work the way the OP wanted with searching on a string in #472, but yes, as you pointed out that's a separate issue. |
the reason behind this patch and add a FIX ME comment to encourage PRs to improve it.
PR #487 is an update to the change log, now including this fix. |
Update changelog with #486 [skip ci]
Thanks 😃 |
This is a try at fixing #472 and it works for me. Arel's update now has an Arel::Nodes::Casted type instead of the original array, so NULL gets passed into the SQL statement. This should cover all cases, and an if statement has been placed so this only will apply for when the Arel::Nodes::Casted type is used.