Sha256: 27968c86cc38f69182395500264e55d33f613499f03a8101630620e520fe26a3
Contents?: true
Size: 730 Bytes
Versions: 62
Compression:
Stored size: 730 Bytes
Contents
module Workarea class Storefront::Users::OrdersController < Storefront::ApplicationController before_action :require_login def index models = Order.recent( current_user.id, Workarea.config.storefront_user_order_display_count ) statuses = Fulfillment.find_statuses(*models.map(&:id)) @orders = models.map do |order| Storefront::OrderViewModel.new( order, fulfillment_status: statuses[order.id] ) end end def show model = Order.find(params[:id]) if model.user_id != current_user.id.to_s head :forbidden and return else @order = Storefront::OrderViewModel.new(model) end end end end
Version data entries
62 entries across 62 versions & 1 rubygems