I want to have a sum of an order by doing something like:
select sum(items.price) from order, items where order.item_id =
Since Order and Item class are related (using “belongs_to”), I thought
I could use:
But that doesn’t work as expected… I have to use:
Order.sum(‘items.price’, :joins => ‘left outer join items on
Isn’t ActiveRecord::Calculations supposed to know that I’m asking for
a join? Why am I supposed to write it?