Sha256: ca1f18d8590e8fc16e454388bd9d846c8ab295c936f052611b49d9775728e3fd

Contents?: true

Size: 516 Bytes

Versions: 13

Compression:

Stored size: 516 Bytes

Contents

module Spree
  class OrderStockLocation < ActiveRecord::Base
    belongs_to :variant, class_name: "Spree::Variant"
    belongs_to :stock_location, class_name: "Spree::StockLocation"
    belongs_to :order, class_name: "Spree::Order"

    def self.fulfill_for_order_with_stock_location(order, stock_location)
      self.where(order_id: order.id, stock_location_id: stock_location.id).each(&:fulfill_shipment!)
    end

    def fulfill_shipment!
      self.update_attributes!(shipment_fulfilled: true)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
solidus_core-1.0.7 app/models/spree/order_stock_location.rb
solidus_core-1.0.6 app/models/spree/order_stock_location.rb
solidus_core-1.0.5 app/models/spree/order_stock_location.rb
solidus_core-1.0.4 app/models/spree/order_stock_location.rb
solidus_core-1.0.3 app/models/spree/order_stock_location.rb
solidus_core-1.0.2 app/models/spree/order_stock_location.rb
solidus_core-1.0.1 app/models/spree/order_stock_location.rb
solidus_core-1.0.0 app/models/spree/order_stock_location.rb
solidus_core-1.0.0.rc2 app/models/spree/order_stock_location.rb
solidus_core-1.0.0.rc1 app/models/spree/order_stock_location.rb
solidus_core-1.0.0.pre3 app/models/spree/order_stock_location.rb
solidus_core-1.0.0.pre2 app/models/spree/order_stock_location.rb
solidus_core-1.0.0.pre app/models/spree/order_stock_location.rb