Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Not In clause not working as expected #43

Open
vsalbaba opened this issue Feb 4, 2012 · 0 comments
Open

Not In clause not working as expected #43

vsalbaba opened this issue Feb 4, 2012 · 0 comments

Comments

@vsalbaba
Copy link

vsalbaba commented Feb 4, 2012

Given posts with ids [1,2,3]
When I do
Post.where(:id.not_in => [])
I expect result to be [1,2,3].

The current generated query is
SELECT posts.* FROM posts WHERE posts.id NOT IN (NULL)

Which returns [].
So, Post where id is not in empty array returns instead of all posts .. an empty array.

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

No branches or pull requests

1 participant