The raw SQL way to say this would be "name IN('john','bob','mike','fred','will')" but I'm not sure how to say that in the Rails finder format.

Walter

On Oct 6, 2010, at 3:34 PM, Jonathan Gill wrote:

Hi all

Not really sure how to put the subject as I know what I want to do,
but really not sure how (or if) I can do it.

What I really want to do is this ;

people.find_by_name(:all,  :conditions => {"name = ?", "john", "bob",
"mike", "fred","will"} )

or possibly

people.find_by_name(:all, :conditions => {"name =?", "john"} )

Ive no idea if this can be done, or if it can, how to do it.

Can someone clue me in?

Many thanks

Jonathan

--
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- [email protected]. To unsubscribe from this group, send email to [email protected] . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en .


--
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to