Rails find :conditions

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-05-05T12:50:54Z Indexed on 2010/05/05 12:58 UTC
Read the original article Hit count: 309

Filed under:
|
|
|
|

I have a Reservation model that I'm searching for with three fields. The container_id must always be self.id but as confirmed and auto_confirmed only one needs to be true. I have the following but it doesn't preform what I need:

Reservation.find(:all, 
:conditions => ['container_id = ? AND confirmed = ? OR auto_confirm = ?', 
self.id, true, true,])

How should I change this?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about mysql