solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Stop passing line_item to compute unit cancelation adjustment's amount

Open BenMorganIO opened this issue 2 years ago • 0 comments

Summary

Simple refactoring for the Spree::UnitCancel. There's no need to do inventory_unit.line_item and then pass the line item through everywhere when we can get it through a has_one. I also changed weighted_amount to accept an arbitrary amount instead of a line item object.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

BenMorganIO avatar Jul 23 '23 16:07 BenMorganIO