searchlogic
searchlogic copied to clipboard
Search with empty array returns all results instead of none
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 !
sounds I only have to use Activity.user_id_is(current_user.friend_ids) :)
#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