[Rails] Re: find_by_id with multiple ids?

2010-10-06 Thread Marnen Laibow-Koser
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

[Rails] Re: find_by_id with multiple ids?

2010-10-06 Thread Jonathan Gill
Hi Marnen > > :conditions => {:name => ['the', 'array', 'goes', 'here']} > Worked perfectly! Many thanks for that! Cheers 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-t...

Re: [Rails] Re: find_by_id with multiple ids?

2010-10-06 Thread Walter Lee Davis
Sorry, I did. Please look at my message in a mail application. Google hides the quote when showing threaded messages. Walter On Oct 6, 2010, at 3:50 PM, Marnen Laibow-Koser wrote: Please quote when replying. Walter Davis wrote: The raw SQL way to say this would be "name IN('john','bob','mi

[Rails] Re: find_by_id with multiple ids?

2010-10-06 Thread Jonathan Gill
Thanks for that Walter. Its getting me a little closer, I'll dig at it and hope I can get it to play nice. I think find_by_sql is my friend here. Many thanks Jonathan On Oct 6, 8:40 pm, Walter Lee Davis wrote: > The raw SQL way to say this would be "name   > IN('john','bob','mike','fred','will

[Rails] Re: find_by_id with multiple ids?

2010-10-06 Thread Marnen Laibow-Koser
Please quote when replying. Walter Davis wrote: > 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 :conditions => {:name => ['the', 'array', 'goes', 'here']} Best, -- Marnen Laibow-Koser