{"record":{"id":"9c5e579484dd6875","repo":"spree/spree","slug":"spree-stock-coordinator-shipments-is-deprecated","errorCode":null,"errorMessage":"Spree::Stock::Coordinator#shipments is deprecated and will be removed in Spree 6.1. Use #fulfillments instead.","messagePattern":"Spree::Stock::Coordinator#shipments is deprecated and will be removed in Spree 6\\.1\\. Use #fulfillments instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"spree/core/app/models/spree/stock/coordinator.rb","lineNumber":20,"sourceCode":"  module Stock\n    class Coordinator\n      attr_reader   :order, :inventory_units\n      attr_accessor :unallocated_inventory_units\n\n      def initialize(order, inventory_units = nil)\n        @order = order\n        @inventory_units = inventory_units || InventoryUnitBuilder.new(order).units\n      end\n\n      def fulfillments\n        packages.map do |package|\n          package.to_fulfillment.tap { |fulfillment| fulfillment.address_id = order.ship_address_id }\n        end\n      end\n\n      # @deprecated Use {#fulfillments}; removed in 6.1.\n      def shipments\n        Spree::Deprecation.warn('Spree::Stock::Coordinator#shipments is deprecated and will be removed in Spree 6.1. Use #fulfillments instead.')\n        fulfillments\n      end\n\n      def packages\n        packages = build_packages\n        packages = prioritize_packages(packages)\n        packages = estimate_packages(packages)\n      end\n\n      def build_packages(packages = [])\n        stock_locations_with_requested_variants.each do |stock_location|\n          units = allocatable_units_for(stock_location)\n          next if units.empty?\n\n          packer = build_packer(stock_location, units)\n          packages += packer.packages\n        end\n","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/spree/spree/blob/06bf66a8684b9de03210bbb2ddc8c1f5ba522fa2/spree/core/app/models/spree/stock/coordinator.rb#L2-L38","documentation":"Spree 6.0 renamed Shipment to Fulfillment throughout the stock layer. Stock::Coordinator#shipments — which builds one Fulfillment per package (`packages.map(&:to_fulfillment)` with the order's ship address stamped on) — is a one-release shim that warns and delegates to `fulfillments`. Removed in 6.1.","triggerScenarios":"Calling `Spree::Stock::Coordinator.new(order).shipments` — legacy checkout/order code, copied pre-6.0 service objects, or extensions that build fulfillments through the coordinator using the old name.","commonSituations":"Host apps or extensions with custom checkout flows that instantiate the Coordinator directly (instead of going through Carts::Complete) and were written against the pre-rename API; resurfaces in deprecation audits on the 6.0 upgrade.","solutions":["Replace `coordinator.shipments` with `coordinator.fulfillments`.","If the surrounding code still talks about 'shipments' end to end, migrate the whole flow to the fulfillment vocabulary (Fulfillment model, delivery_rates, to_fulfillment) rather than renaming one call.","Prefer routing through the standard workflows (Carts::Complete) instead of driving the Coordinator by hand, if your customization allows it.","Update extensions to 6.0-compatible releases; silence with `Spree::Deprecation.silence { ... }` only temporarily."],"exampleFix":"# before\nfulfillments = Spree::Stock::Coordinator.new(order).shipments\n\n# after\nfulfillments = Spree::Stock::Coordinator.new(order).fulfillments","handlingStrategy":"validation","validationCode":"Spree::Deprecation.behavior = :raise # in spec/rails_helper.rb\n\n# audit: grep -rn \"Coordinator.new.*\\.shipments\\|\\.shipments\\b\" app/ lib/ spec/ | grep -v fulfillment","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid driving Stock::Coordinator directly in host code — the supported entry points are the checkout workflows, which absorb these renames for you.","When copying stock-layer service code between Spree versions, rename the whole vocabulary (shipment/shipping → fulfillment/delivery) in one pass.","Keep deprecations raised in test so old names fail their specs the day they're introduced."],"tags":["ruby","spree","deprecation","stock","shipment-to-fulfillment-rename"],"backgroundTag":"ruby-deprecation-warning","analyzedSha":"06bf66a8684b9de03210bbb2ddc8c1f5ba522fa2","analyzedAt":"2026-08-21T14:59:48.125Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}