This project is archived and is in readonly mode.

#4441 ✓duplicate
Daniele Orlandi

Arel is not building the correct expression for not(nil) as "IS NOT NULL"

Reported by Daniele Orlandi | April 19th, 2010 @ 06:21 PM | in 3.0.2

Hello,

Building the expression with not(nil) does not produce a IS NOT NULL as expected but a '!= NULL' which does not work on PosgreSQL.

>> Hel::Core::Person.where(Hel::Core::Person.scoped.table[:name].eq(nil)).to_sql
=> "SELECT     "core_people".* FROM       "core_people" WHERE     ("core_people"."name" IS NULL)"

>> Hel::Core::Person.where(Hel::Core::Person.scoped.table[:name].not(nil)).to_sql
=> "SELECT     "core_people".* FROM       "core_people" WHERE     ("core_people"."name" != NULL)"

Comments and changes to this ticket

Create your profile

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

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages