-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the inventory unit builder configurable
This adds the inventory unit builder (Spree::Stock::InventoryUnitBuilder by default) to the Spree::Config.stock configuration, so that it can be overridden. This is desirable for any store that doesn't have a one-to-one mapping between purchased variants and the fulfilled inventory units. The extension solidus_product_assembly heavily overrides this class to accomplish this, so with this change it will be able to stop decorating Spree::Stock::InventoryUnitBuilder and instead provide its own. I'll admit that I'm not a huge fan of how I tested the functionality in the order class, but there's a reason for stubbing the preference like that. Spree::Config.stock isn't a normal config object, so it doesn't support our test helpers for stubbing preferences within the context of only a single test.
- Loading branch information
1 parent
3c72462
commit 2483b46
Showing
6 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters