Craig White wrote: [...] > What I want to do is rather complex and ez-where handled this for me > simply. I want to... > > @debtor = Debtortrans.find(:all, > :conditions => ["trandate > ? and trandate < ? AND taxauthid = ?", > @per1, @per2, "24"], > :joins => 'LEFT JOIN debtortranstaxes ON > debtortranstaxes.debtortransid=id'
The simple case is easy. But you don't need a plugin even for the complex case. > > but I actually want > > trandate > ? AND trandate < ? AND ( > taxauthid = ? > or > taxauthid = ? > or > taxauthid = ? > or > taxauthid = ? ) So do :conditions => ['trandate BETWEEN :begin AND :end AND taxauthid IN :ids', {:begin => start_date, :end => end_date, :ids => [id1, id2, id3]}]. Simple. (You might need parentheses around :ids in the query. I'm not sure.) Best, -- Marnen Laibow-Koser http://www.marnen.org mar...@marnen.org -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---