diff --git a/core/app/models/spree/shipment.rb b/core/app/models/spree/shipment.rb index 67203f8e9c0..8e8a9caa230 100644 --- a/core/app/models/spree/shipment.rb +++ b/core/app/models/spree/shipment.rb @@ -13,6 +13,7 @@ class Shipment < Spree::Base has_many :shipping_methods, through: :shipping_rates has_many :state_changes, as: :stateful has_many :cartons, -> { distinct }, through: :inventory_units + has_many :line_items, -> { distinct }, through: :inventory_units before_validation :set_cost_zero_when_nil @@ -188,10 +189,6 @@ def item_cost line_items.map(&:total).sum end - def line_items - inventory_units.includes(:line_item).map(&:line_item).uniq - end - def ready_or_pending? ready? || pending? end