mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Spree 2 doesn't have `Product#on_hand=` any more. We actually can't save stock levels without saving the product first which creates a stock item. This hacky solution overwrites the attribute in the entry so that it gets copied to the variant later on. I think a better solution needs some refactoring as proposed in: https://github.com/openfoodfoundation/openfoodnetwork/issues/2783#issuecomment-459601530