Fix #38
This commit is contained in:
parent
dc73128508
commit
5a5fbdf1c9
1 changed files with 2 additions and 3 deletions
|
@ -8,9 +8,8 @@ class OrdersController < ApplicationController
|
|||
init
|
||||
@order = @user.orders.build
|
||||
|
||||
# products = @user.products.select("products.*", "sum(order_items.count) as count").group(:product_id).order("count desc")
|
||||
# @order.g_order_items(products)
|
||||
@order.g_order_items Product.all
|
||||
products = (@user.products.select("products.*", "sum(order_items.count) as count").group(:product_id).order("count desc") | Product.all)
|
||||
@order.g_order_items products
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
Loading…
Reference in a new issue