Simplify buggy tax rate migration #1062
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This migration did not work, and requires a call to
TaxRate#compute_amount
.We could have fixed the "the does not work", but the
compute_amount
call requireshalf of Solidus' object graph (including the
Spree::Calculator
STI table as wellas
Spree::Order
,Spree::Shipment
,Spree::TaxRate
- this is still not exhaustive).We felt adding all of those into the migration was less than ideal, especially if your
local shipping rate was taxed using a different system than the default tax calculator.
The downside of this is ONLY that in the backend for old shipping orders, you will not be
shown the shipping rate tax (included or additional).
The reduced-in-complexity migration now just adds the
tax_rate_id
column onSpree::ShippingRate
.