Ruby: How to get array instead of DataMapper::Collection in query result

here is my code:

today_ids_from_db = Rating.all(:fields => 'my_id', :ts_d =>

today_ids_from_db.class == DataMapper::Collection

but I need to get simple ruby array with my_id values

how to achieve this?


Try this code

Rating.all(:ts_d =>

You can also try out this Activerecord beauty called pluck

Rating.where(:ts_d =>

Need Your Help

Why is this basic json call not working?

ajax json model-view-controller

The following JSON call always hits the AJAX error handler, and I can't figure out why:

R loop dataframe and create a vector from each row

r loops

New to R. I am trying to create a vector from each row in a dataframe, and name the vector after the position in the dataframe. Sample data: