Class: Cartify::OrdersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/cartify/orders_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



7
8
9
10
# File 'app/controllers/cartify/orders_controller.rb', line 7

def index
  all_in_one = cartify_current_user.orders.includes(:delivery, :order_status, :order_items)
  @orders = Cartify::OrdersQuery.new(all_in_one).run(params[:filter]).decorate
end

#showObject



12
13
14
15
# File 'app/controllers/cartify/orders_controller.rb', line 12

def show
  @order = cartify_current_user.orders.find(params[:id]).decorate
  redirect_to checkout_path(:confirm) if @order.status == t('order.status.in_progress')
end