Sha256: 39b1e2a1d4aef3fd15740ce988874ad1e976296e1eeaa175b93c802058fe9f8e

Contents?: true

Size: 552 Bytes

Versions: 5

Compression:

Stored size: 552 Bytes

Contents

module Spree
  module Admin
    class StockItemsController < Spree::Admin::BaseController
      before_filter :determine_backorderable

      def update
        stock_item.save
        respond_to do |format|
          format.js { head :ok }
        end
      end

      private

      def stock_item
        @stock_item ||= StockItem.find(params[:id])
      end

      def determine_backorderable
        stock_item.backorderable = params[:stock_item].present? && params[:stock_item][:backorderable].present? ? true : false
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree_backend-2.0.3 app/controllers/spree/admin/stock_items_controller.rb
spree_backend-2.0.2 app/controllers/spree/admin/stock_items_controller.rb
spree_backend-2.0.1 app/controllers/spree/admin/stock_items_controller.rb
spree_backend-2.0.0 app/controllers/spree/admin/stock_items_controller.rb
spree_backend-2.0.0.rc1 app/controllers/spree/admin/stock_items_controller.rb