#121 new
Christian van der Leeden

querying for is_not(nil) does not produce correct SQL (on Postgres)

Reported by Christian van der Leeden | March 2nd, 2010 @ 04:42 AM

I'm trying to find all users who do have a generator tag set by running:

User.generator_tag_is_not(nil)

The SQL produced is:

SELECT * FROM "users" WHERE (users.generator_tag != NULL)

but should be:

SELECT * FROM "users" WHERE (users.generator_tag is not NULL)

This works fine:

User.generator_tag_is(nil)
=> SELECT * FROM "users" WHERE (users.generator_tag is NULL)

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Provides common named scopes and object based searching.

People watching this ticket

Pages