Skip to content

Commit

Permalink
Remove OrderStockLocations
Browse files Browse the repository at this point in the history
These are no longer functional since the introduction of
Stock::SimpleCoordinator. They have not been creatable by admins since
Solidus 2.2.
  • Loading branch information
jhawthorn committed Oct 26, 2017
1 parent cfe03e6 commit 96a553d
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 48 deletions.
2 changes: 0 additions & 2 deletions core/app/models/spree/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ def states
pluck(:state).uniq
end
end
has_many :order_stock_locations, class_name: "Spree::OrderStockLocation"
has_many :stock_locations, through: :order_stock_locations

# Adjustments and promotions
has_many :adjustments, -> { order(:created_at) }, as: :adjustable, inverse_of: :adjustable, dependent: :destroy
Expand Down
5 changes: 0 additions & 5 deletions core/app/models/spree/order_shipping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,13 @@ def ship(inventory_units:, stock_location:, address:, shipping_method:,
end

send_shipment_emails(carton) if stock_location.fulfillable? && !suppress_mailer # e.g. digital gift cards that aren't actually shipped
fulfill_order_stock_locations(stock_location)
@order.recalculate

carton
end

private

def fulfill_order_stock_locations(stock_location)
Spree::OrderStockLocation.fulfill_for_order_with_stock_location(@order, stock_location)
end

def send_shipment_emails(carton)
carton.orders.each do |order|
Spree::Config.carton_shipped_email_class.shipped_email(order: order, carton: carton).deliver_later
Expand Down
15 changes: 0 additions & 15 deletions core/app/models/spree/order_stock_location.rb

This file was deleted.

18 changes: 0 additions & 18 deletions core/spec/models/spree/order_stock_location_spec.rb

This file was deleted.

8 changes: 0 additions & 8 deletions core/spec/models/spree/shipment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -525,14 +525,6 @@
allow(shipment).to receive_messages(require_inventory: false, update_order: true, state: state)
end

it "should call fulfill_order_with_stock_location" do
expect(Spree::OrderStockLocation).to(
receive(:fulfill_for_order_with_stock_location).
with(order, stock_location)
)
shipment.ship!
end

it "finalizes adjustments" do
shipment.adjustments.each do |adjustment|
expect(adjustment).to receive(:finalize!)
Expand Down

0 comments on commit 96a553d

Please sign in to comment.