Refactor stock related service objects to deal with inventory units.

Prior to this change, stock related service objects (coordinator, packer,
prioritizer, package, adjuster) were tightly coupled to orders and line
items, such that they would only create a set of shipments for the set
of line items for an order.

This change makes those objects work with inventory units, which enables
future enhancements that would create shipments for an order that are
not necessarily tied to the initial purchase (e.g. upcoming exchanges
work).
yup thats another option for sure, it's just that like I said even though
the core idea here is super awesome the implementation details api changes
bothered me. Having an explicit order accessor looks more clear to me plus
we shouldn't rely on eager loading imo.

either way couldn't play with this yet as much as I wanted yet, perhaps
it's alright and order won't be missed at all


On Tue, Jul 29, 2014 at 2:47 PM, Jeff Dutil <notifications@github.com>
wrote:

> In core/app/models/spree/stock/package.rb:
>
> >        attr_accessor :shipping_rates
> >
> > -      def initialize(stock_location, order, contents=[])
> > +      def initialize(stock_location, contents=[])
>
> @huoxito <https://github.com/huoxito> can't the order be passed to the
> options hash? { order: @order <https://github.com/order> } then within
> the method options[:order]?
>
> Also the contents passed to the package could have the order eager loaded
> already when passed in if necessary.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/spree/spree/pull/5042/files#r15539604>.
>



-- 
Washington L Braga Jr

Developer
Spree Commerce, Inc.