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

Using empty array with _any gives all results #148

Open
chadb opened this issue Jul 15, 2011 · 0 comments
Open

Using empty array with _any gives all results #148

chadb opened this issue Jul 15, 2011 · 0 comments

Comments

@chadb
Copy link

chadb commented Jul 15, 2011

This may entirely by my ignorance of searchlogic.

Giving an empty array to id_is_any() returns all rows. Seems like it should return 0 rows.

ruby-1.8.7-p330 :038 > current_account.groups.id_is_any( [ ] ).ascend_by_name.count
SQL (2.5ms) SELECT count(*) AS count_all FROM groups WHERE ((groups.account_id = 1))
=> 3834

_Using is works correctly.

ruby-1.8.7-p330 :040 > current_account.groups.id_is( [ ] ).ascend_by_name.count
SQL (0.5ms) SELECT count(*) AS count_all FROM groups WHERE ((groups.id IN (NULL)) AND (groups.account_id = 1))
=> 0

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

1 participant