Rob Biedenharn wrote:
> On Oct 6, 2010, at 3:34 PM, Jonathan Gill wrote:
>> 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'])

I wasn't absolutely sure if the find_by_* syntax would also take an 
array.  Good to know!

> 
> -Rob
> 
> Rob Biedenharn

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
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 [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