Displaying 1 result from an estimated 1 matches for "match_for_assignment".
2006 Aug 09
1
help:sql search for NULL
...I want to 
be able to find out all the  matches for any assignment. The search 
should retrun the match if the corresponding filed is NULL as well.
I wrote down the following code but it doesn''t return anything. I wonder 
what  I am doing wrong. Any help is greately appreciated.
 def self.match_for_assignment(assignment)
    self.find(:all,
              :conditions => [''matches.member_id IN (?, NULL) AND 
matches.study_id   IN (?, NULL) AND matches.tag_id IN (?, NULL)'',
                              assignment.member.id, assignment.study.id, 
assignment.tag.id])
  end
-- 
Posted...