This project is archived and is in readonly mode.
active record conditions to deal with nils in arrays
-
Michael Koziarski
- Tag changed from patch to activerecord, patch
- State changed from new to wontfix
This doesn't seem like something we should be changing. The whole issue on whether 'null is a value' is something that's pretty deeply held amongst relational theorists and the IN (NULL) behaviour is intentional.
I think this is just one of those cases where the impedence mismatch between the ruby and SQL view of the world is incompatible and you need to handle that in code.
-
Nick Sellen
ok
activerecord already makes allowance for a nil/null oddity, i.e.:
:conditions => {:something => nil}(resulting in "something is null" rather than "something = " as for any other value)
... my feeling is that as the user experience ends up inconsistent and that as ruby nil is already not simply translated to SQL null (as in the above example) that not much is gained by passing SQL's strange idea of null through to the ruby world where nil very much is a value.
