Rails couldn't find a valid model for Doorkeeper::AccessToken association

62 views Asked by At

Added the below association in my user model:

has_many :access_tokens, class_name: 'Doorkeeper::AccessToken',
                           foreign_key: :resource_owner_id,
                           dependent: :delete_all

Getting this Error: `NameError (Rails couldn't find a valid model for Doorkeeper::AccessToken association. Please provide the :class_name option on the association declaration. If :class_name is already provided, make sure it's an ActiveRecord::Base subclass.

      raise NameError, msg
      ^^^^^):`

Rails Version: 7.0.3 Ruby Version: 3.1.2

Expected: No error of Doorkeeper::AccessToken

0

There are 0 answers