Forum: Ruby on Rails compound conditions in find

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Craig W. (Guest)
on 2006-02-09 01:26
(Received via mailing list)
can't seem to find the right syntax for this...

syntax error
          :conditions => [["placements.client_id = ?",
params[:client_id] ] and "placements.discharge_date IS NOT NULL" ],

this part works...
:conditions => ["placements.client_id = ?", params[:client_id] ]

this is what I want to add...
"placements.discharge_date IS NOT NULL"

You can see above one of the many various ways I have tried to tie them
together to make a syntactically correct :conditions statement for a


You'll be happy to know that I got if/then/elsif/end worked out by


David M. (Guest)
on 2006-02-09 01:41
(Received via mailing list)
:conditions => ["placements.client_id = ? and
placements.discharge_date IS NOT NULL", params(:client_id)]
Craig W. (Guest)
on 2006-02-09 03:12
(Received via mailing list)

I simply could not intuit anything close to that but now that I see it,
I realize that this is sort of a deference to sql.


I have made heaps of progress

This topic is locked and can not be replied to.