After some further digging in the code, "to_a" is used in a host
of contexts.  Not just Model.find(), but things like

  params[:blah].to_a.include?('some key string')

and a number of others.  

I think I'll be needing both the assumed new behavior of 
find(:all), and the Array() call.

I'm curious, where is this Array() method defined, and what
is it exactly?  A method named like a class?  Or am I actually
"invoking" the class in a method-ish way?  Where might I
find documentation on this?

Thanks...

        -glenn

Pat Allan wrote:
> Hmm, I never knew that it originally returned nil if there were no  
> matches.
> 
> A replacement for .to_a though, if needed (although Jordan's  
> recommendation is the best):
> people = Array(Person.find(blah blah))
> 
> If the argument to Array is an array, that's what gets returned. If  
> it's anything else, that becomes a single item in an array).
> 
> Cheers
> 

--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to