I'm studying Redmine application by Rails.
I make the query as below:
re = Issue.select("sum(id) as test_total").group("tracker_id")
But I can not get the 'total_price' value. Here's the result of 're.inspect'
[#<Issue >, #<Issue >, #<Issue >]
It's only array of empty Issue objects.
Then I see the query in log:
SELECT sum(id) as test_total FROM "issues" GROUP BY tracker_id
If I run this query by database console, the result is:
| test_total | ------------- | 1 | ------------- | 2 | ------------- | 3 | -------------
It's 3 rows of result.
The previous 're' has 3 elements but each element is one empty Issue object.
How can I get 'total_price' from 're'?
Thank you.