I have the following line of code in my controller’s action method:
@needs = Need.find(:all, :conditions => “fulfilled_date = ‘null’”)
This returns no records to the view, but I am expecting one record.
The following line in MySQL will return the record I expect:
Select * from needs where fulfilled_date is null;
To test the code, I substituted :conditions => “id = ‘1’” and this did
return a record. That was to test the general validity of the code.
So I tried changing ‘null’ to ‘’ and to ‘nil’ Nothing. Also tried
changing = to is, which caused a syntax error. Not finding an explicit
example in my books, I resorted to trying everything I could think of.
Nothing worked, which brings me here.
Being new at this, I’m missing something (obviously). Was hoping someone
might point out what that is (which is not obvious).
Any help is of course much appreciated.