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

Search with empty array returns all results instead of none #29

Open
gravis opened this issue Sep 14, 2009 · 2 comments
Open

Search with empty array returns all results instead of none #29

gravis opened this issue Sep 14, 2009 · 2 comments

Comments

@gravis
Copy link

gravis commented Sep 14, 2009

Not sure I understand correctly, it might not be a bug.
If I use :

Activity.user_id_equals_any(current_user.friend_ids)
I expect this to be equivalent to
Activity.all(:conditions => {:user_id => current_user.friend_ids})

and it's not. The first expression will return all activities if the user doesn't have friends, and the second no activity, as expected.

thanks !

@gravis
Copy link
Author

gravis commented Sep 14, 2009

sounds I only have to use Activity.user_id_is(current_user.friend_ids)
:)

@DCarper
Copy link

DCarper commented Mar 9, 2011

#search(nil) also returns a full result set.. might be working as intended but it means an extra if statement for every search action.

Not a huge deal either way.

Best,
Dan

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