Forum: Ruby on Rails compound conditions in find

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-02-09 00:26
(Received via mailing list)
can't seem to find the right syntax for this...

/script/../config/../app/controllers/placements_controller.rb:155:
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
find...

???

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

;-)

Craig
F3dc06f587d1ff4c7366b102bfda9204?d=identicon&s=25 David Mitchell (Guest)
on 2006-02-09 00:41
(Received via mailing list)
:conditions => ["placements.client_id = ? and
placements.discharge_date IS NOT NULL", params(:client_id)]
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-02-09 02:12
(Received via mailing list)
Yep...

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.

Thanks

I have made heaps of progress

Craig
This topic is locked and can not be replied to.