This project is archived and is in readonly mode.
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
-
Santiago Pastorino April 22nd, 2010 @ 12:24 AM
- Milestone cleared.
- Tag changed from arel rails3 to arel rails3, patch
- State changed from new to verified
- Assigned user set to Emilio Tagua
I've fixed this with this commit http://github.com/spastorino/arel/commit/a7a5027f4f17e12cf11c310dd8...
-
Santiago Pastorino April 22nd, 2010 @ 12:30 AM
BTW please report arel things on http://arel.lighthouseapp.com/projects/36051-arel/overview
Thanks. -
Santiago Pastorino April 22nd, 2010 @ 12:32 AM
- State changed from verified to duplicate
This bug is for Arel LH
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Medium
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>