A Ruby function for assigning a query to an array?

I am wondering if anyone knows of a function for push a MySQL query
result to an array? Right now I have to loop through the result, not bad
but somewhat ugly and annoying for naming standards.

Regards,

Ryan

On Wed, Aug 6, 2008 at 11:11 AM, Ryan K. [email protected] wrote:

I am wondering if anyone knows of a function for push a MySQL query result
to an array? Right now I have to loop through the result, not bad but
somewhat ugly and annoying for naming standards.

Regards,

Ryan

I would suggest trying one of the many ORM libraries out there: Sequel,
DataMapper, ActiveRecord…

Usually they will give you your results in some array of hashes form.


“Hey brother Christian with your high and mighty errand, Your actions
speak
so loud, I can’t hear a word you’re saying.”

-Greg Graffin (Bad Religion)

Funny you should say that because the moment after I sent that out I got
an email from Jeremy E. that was posting to the list about Sequel
2.4.0 release. I had a good laugh. Thanks for the suggestions though.

Regards,

Ryan