Agile Web D. with Rails doesn’t seem to have NULL in the
index [or my eyes have failed me again], and web searching turns up
lots of SQL statements containing NOT NULL.
I have a table of loans, and I want to record when something was
loaned and returned. The loan date can’t be null, or there’d be
no entry in the table. The return date must be something until
the item is returned, and NULL seems a sensible sentinal value.
How does one
Loan.find(:all, :conditions => [":return = ?" , something])
to pick up the null entries, thus items that haven’t been returned?
I’m thinking that “:return = NULL” might match a string “NULL”, but
can’t find confirmation or denial of this…
Maybe there’s another idiom for this kind of problem? (Setting a
return date in the year 3000 seems like a bodge, and it would
overflow Unix ideas of time anyway…)
Thank you,
Hugh