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.
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.
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:
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: https://github.com/solidusio/solidus_paypal_braintree/issues/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.