Sha256: 0b7510b126d3b1cd9acbfc1cb6db05169c03f36873f136f7ac85492064828151

Contents?: true

Size: 538 Bytes

Versions: 23

Compression:

Stored size: 538 Bytes

Contents

module Spree
  module Admin
    module OrderConcern
      extend ActiveSupport::Concern

      included do
        rescue_from ActiveRecord::RecordNotFound, with: :resource_not_found
      end

      protected

      def load_order
        @order = current_store.orders.find_by!(number: params[:order_id])
        authorize! action, @order
        @order
      end

      def resource_not_found
        flash[:error] = flash_message_for(model_class.new, :not_found)
        redirect_to spree.admin_orders_path
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
spree_backend-4.8.4 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.8.3 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.8.2 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.8.1 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.3.3 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.7.2 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.6.2 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.7.1 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.7.0 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.6.1 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.6.0 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.5.1 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.5.0 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.3.2 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.4.1 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.4.0 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.4.0.rc2 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.3.1 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.4.0.rc1 app/controllers/concerns/spree/admin/order_concern.rb
spree_backend-4.3.0 app/controllers/concerns/spree/admin/order_concern.rb