solidus
solidus copied to clipboard
Stop passing line_item to compute unit cancelation adjustment's amount
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:
- [x] I have written a thorough PR description.
- [x] I have kept my commits small and atomic.
- [x] I have used clear, explanatory commit messages.
The following are not always needed: