app/models/order.rb
#update inventory count after order is placed
update inventory count after order is placed
update inventory count after order is placed
def product_inventory_update
    uniq_product.each do |product|
      product.inventory -= item_product_count(product)
      product.save
    end
  end
def product_inventory_update uniq_product . each do | product | product . inventory -= item_product_count ( product ) product . save end end
update inventory count after order is placed
update inventory count after order is placed