How to get array with clear data from Active Record query without using map

Posted by Suborx on Stack Overflow See other posts from Stack Overflow or by Suborx
Published on 2010-06-01T14:38:05Z Indexed on 2010/06/01 14:43 UTC
Read the original article Hit count: 364

Filed under:
|

Hi I would like to ask if its possible get array with clear data from ActiveRecord query without using map, collect or each.

names = User.find(:all, :select => "name")
return names == [#<User name:"Peter">,#<User name:"Martin">]

and I want names == ["Peter", "Martin"] without using map, collect or each. Thanks for your answers.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about activerecord