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

Improve developer experience when changing payment methods. #3802

Open
kennyadsl opened this issue Oct 21, 2020 · 1 comment
Open

Improve developer experience when changing payment methods. #3802

kennyadsl opened this issue Oct 21, 2020 · 1 comment
Labels
type:bug Error, flaw or fault

Comments

@kennyadsl
Copy link
Member

It happens that stores change their payment method over the years. When switching to a new extension it's a good practice to remove the old one once the migration is done. But by doing so, we'll have a lot of references in the database that points, through STI, to a class that doesn't exist anymore.

When this happens, we should find a way to avoid the application to raise an exception similar to:

ActiveRecord::SubclassNotFound (The single-table inheritance mechanism failed to locate the subclass: 'Solidus::Gateway::BraintreeGateway'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Spree::PaymentMethod.inheritance_column to use another column for that information.)

I'm not sure it's possible, I'd make an attempt to explore some possible solutions though.

Solidus Version:
All solidus versions

To Reproduce

See this issue as an example: solidusio/solidus_paypal_braintree#184

Additional context

An alternative could be documenting best practices for switching from a payment method to another in our guides, in order to point users to a good resource when they are facing this scenario.

@kennyadsl kennyadsl added the type:bug Error, flaw or fault label Oct 21, 2020
@peterberkenbosch
Copy link
Contributor

@kennyadsl this has been on my radar as well here: solidusio-contrib/solidus_affirm_v2#9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error, flaw or fault
Projects
None yet
Development

No branches or pull requests

2 participants