spree/spree — pull request #3991 by huoxito (2013-11-20 22:58:14+00:00)
Title: Associate InventoryUnit and LineItem

Hey guys it's been a while I wanted to propose this with code.

While working on the product-assembly extension I found myself having to monkey patch the whole shipment process. Mostly because in the assembly we have the line item as a virtual product composed of parts (read variants) which is what actually gets shipped. By associating inventory units with line items directly in the core project we should be able to work with assemblies without too much overriding.

This doesn't add any new feature to the core of the spree but I believe it makes it way more extensible. Hopefully more benefits can come from this other than just the assembly use case.

This diff here looks huge but most of it is related to specs updates. The real core changes should be in Package, Shipment, OrderInventory and InventoryUnit. I probably still need to update more places to take advantage of the new association but it got to a state where I think it is safe to be merged in master. Let me know your thoughts on this.

// @BDQ @radar