mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-12 03:50:22 +00:00
For some inexplicable reason `order_cycle.exchanges.incoming.first` and `order_cycle.exchanges.incoming.second` were returning the same exchange. Subsequently the inventory items being created were for the same variant, which throws an error due to a uniqueness validation in InventoryItem on variant_id. Changing from #first and #second to #first and #last results in the correct exchanges being assigned.