I have orders, order_items, and products.
I want to collate several orders so that I can get a SUM of quantities
ordered for each product etc.
Can I say something like (the below gives an error on :sum, and ignores
OrderItem.find(:all, :sum => ‘quantity’, :group => ‘product_id’,
:include => [:order, :product])
I want to get back a collection of order_items, GROUPed BY product_id.
It is important for me to get back order_items, as then I can get to the
product using the belongs_to association to get the name of the product,
plus the business rules to calcualte the price of the product.