Here's an attempt at resolving the scenario in which there are no related products with no discount on the DB. The original implementation was returning nil but Spree 3.1 is using the return of compare and adding it to the total so the sum operation was failing. The fix proposed here is to return 0 when the promotion is not eligible, plus to compare for master products instead of specific variants.
Here's an attempt at resolving the scenario in which there are no related products with no discount on the DB. The original implementation was returning nil but Spree 3.1 is using the return of
compare
and adding it to the total so the sum operation was failing. The fix proposed here is to return 0 when the promotion is not eligible, plus to compare for master products instead of specific variants.