Fixing “NameError (undefined local variable or method ‘to_adapter’ for class User)” In Rails 8 with…

Recently, I ran into a strange error while working on a Rails 8 API with Devise and DeviseTokenAuth: