searchlogic icon indicating copy to clipboard operation
searchlogic copied to clipboard

Search with empty array returns all results instead of none

Open gravis opened this issue 16 years ago • 2 comments

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 avatar Sep 14 '09 21:09 gravis

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

gravis avatar Sep 14 '09 21:09 gravis

#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

DCarper avatar Mar 09 '11 19:03 DCarper