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.
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.
…
I wasted 3 hours yesterday trying to do this very same thing…
Eventually I had to revert 3 hours of coding because I hit a
brick wall ;-(
So - does anybody else know how to use :group and :sum in a find(:all)
method?
bmgz wrote:
Mikkel B. wrote:
…
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.
…
I wasted 3 hours yesterday trying to do this very same thing…
Eventually I had to revert 3 hours of coding because I hit a
brick wall ;-(
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.