Skip to content
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

1.6.0 Regression: Searching with array arguments. #492

Closed
keichan34 opened this issue Jan 14, 2015 · 2 comments
Closed

1.6.0 Regression: Searching with array arguments. #492

keichan34 opened this issue Jan 14, 2015 · 2 comments

Comments

@keichan34
Copy link

Works in 1.5.1:

> User.ransack(id_in: [1, 2]).result.to_sql
=> "SELECT `users`.* FROM `users` WHERE `users`.`id` IN (1, 2)"

1.6.0:

> User.ransack(id_in: [1, 2]).result.to_sql
NoMethodError: undefined method `map' for 1:Fixnum
from /___/.gem/ruby/2.2.0/gems/ransack-1.6.0/lib/ransack/adapters/active_record/ransack/nodes/condition.rb:34:in `return_predicate'

https://github.com/activerecord-hackery/ransack/blob/v1.6.0/lib/ransack/adapters/active_record/ransack/nodes/condition.rb#L34

Tested on the current master (9d56e60), same results.

Seems to be related to the fix in #472.

Is this just me, or are other people having problems with this too?

@jonatack
Copy link
Contributor

Thanks. Issue reported by #493 and I've reproduced it as well.

jonatack added a commit that referenced this issue Jan 14, 2015
This is a patch to address a regression in v1.6.0
caused by a missing test on a fix, and probably
needs a deeper look.

TODO: Put the test in a more logical place.
@keichan34
Copy link
Author

Thanks for the quick fix! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants