ambition should use 'is' for NULL instead of ==
Reported by David Chelimsky | August 30th, 2007 @ 06:22 AM
This statement:
LanguageElement.select{|e| e.parent_id == nil}
produces this:
SELECT * FROM language_elements WHERE (language_elements.`parent_id` = NULL)
but should produce this:
SELECT * FROM language_elements WHERE (language_elements.`parent_id` is NULL)
The attached patch makes it so.
Cheers,
David
Comments and changes to this ticket
-
David Chelimsky August 31st, 2007 @ 07:49 AM
You're welcome. Just happens that the first thing I tried it on needed that :)
This is a really great idea Chris. In addition to making finders feel more like Ruby, it also 'feels' like (I could be dreaming here) it can go a long way to better decouple Rails' component layers. That's just an instinct. Maybe I'm crazy.
Anyhow, thanks for sharing this with the world, and thanks for accepting my patch :)
Cheers,
David
-
Chris Wanstrath August 31st, 2007 @ 12:41 PM
- State changed from resolved to open
Hey, thanks for the patch.
I'm reopening this bug as a 'note to self' because I need to add IS NOT NULL.
-
Chris Wanstrath September 1st, 2007 @ 03:26 PM
- State changed from open to resolved
Okay, fixed that up in http://projects.require.errthebl...
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป