This is probably a really easy problem to solve, but I have a query that pulls data from two models. The only thing I want to see from this query would be the averages (numbers at the end of each string), in an array. However, the output currently looks like this:
{"[\"Orthodontist\", 2011, 4]":"545625.5","[\"Orthodontist\", 2011, 3]":"534927.0","[\"Orthodontist\", 2011, 2]":"524438.5","[\"Orthodontist\", 2011, 1]":"514155.5"}
I want the array to look like this:
[545625.5, 534927.0, 524438.5, 514155.5]
The code looks like this:
<%= Quarter.includes(:client).group('clients.specialty', 'quarters.year','quarters.quarter').limit(4)
.order('quarters.created_at DESC').average('quarters.collections').to_json %>
What should I do?