Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify buggy tax rate migration #1062

Merged
merged 1 commit into from Apr 13, 2016
Merged

Simplify buggy tax rate migration #1062

merged 1 commit into from Apr 13, 2016

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Apr 13, 2016

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 requires
half of Solidus' object graph (including the Spree::Calculator STI table as well
as 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 on Spree::ShippingRate.

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 requires
half of Solidus' object graph (including the `Spree::Calculator` STI table as well
as `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 on `Spree::ShippingRate`.
@jhawthorn
Copy link
Contributor

👍 I think the previous migration was just too big and slow to run. Could we also update the CHANGELOG explaining this limitation.

@tvdeyen
Copy link
Member

tvdeyen commented Apr 14, 2016

I'm not happy with this just being removed and leaving the stores somehow "broken". Even within the change log entry are no hints on how to get the old state back, besides "updating the shipping rates".

Why don't we take the code and move it into a rake task "solidus:recalculate_shipment_taxes"?

I totally agree that a migration isn't the right place, but leaving this "unfixed" isn't an option for me either. Or am I too strict here?

/c @cbrunsdon

@mamhoff
Copy link
Contributor Author

mamhoff commented Apr 14, 2016

@tvdeyen Have a look at the upgrade strategy detailed in #1068.

@tvdeyen tvdeyen deleted the remove-buggy-shipping-rate-migration branch April 14, 2016 09:35
@tvdeyen
Copy link
Member

tvdeyen commented Apr 14, 2016

👍

@cbrunsdon
Copy link
Contributor

Aye, good plan here, thanks folks 👍

bbuchalter pushed a commit to TommyJohnWear/solidus that referenced this pull request Nov 18, 2016
We removed code from a migration in solidusio#1062 - this commit explains the
(minimal) consequences of that removal in the changelog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants