```
class Product < ActiveRecord::Base

      belongs_to  :category
      has_many  :order_items, dependent: :destroy
    end

class OrderItem < ActiveRecord::Base
  belongs_to :order
  belongs_to :product
end

```

I need to list all product with their sum of quantity from order\_item and sum of their total\_price 

```
Product
id    name
1    product_1

OrderItem
product_id order_id quantity total_price
 1            1      10        200
 1            2      10        200

for example expecting output should be
name       quantity   total_price
product_1  20         400

```