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

If you want a dynamic finder on name that returns any number of Person records, then you simply want:

Person.find_all_by_name(['john', 'bob', 'mike', 'fred', 'will'])

-Rob

Rob Biedenharn          
r...@agileconsultingllc.com     http://AgileConsultingLLC.com/
r...@gaslightsoftware.com               http://GaslightSoftware.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-t...@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.

Reply via email to