spree/spree-product-assembly — pull request #33 by sohara (2013-06-11 14:29:51+00:00)
Title: Add failing spec for orders in backend that have both an assembly and a product that is a constituent of that assembly

This adds a failing spec for orders with both:
- A product assembly
- An item that is a product that also belongs to that assembly

Viewing such orders in the backend causes an sql exception due to the ambiguous semantics of the assemblies_for method in such contexts.

It seems difficult, in the case of a such an order to know whether a given InventoryUnit represents the item that is part of an assembly or just an individual line_item that was sold at the same time... I think the only way to be able to distinguis this unambiguously would be to persist such information at the db level, which would require adding a database migration to add e.g. a line_item_id to inventory unit? I'm not sure what's the best way to proceed here, but would like to discuss it.

Another, related, issue, is whether the extension should allow sourcing the parts of the bundle from multiple stock locations, or whether they should all come from the same stock location. I think we would prefer the latter but perhaps others who use the extension would not.

I think also that generally this extension poses challenges for the new split shipments API and I will try to file a clearly explained issue about it today.

@huoxito @schof