Skip to content

Rails will get redefined when using devise-doorkeeper #43

@bvogel

Description

@bvogel

When using devise :doorkeeper in a model, the Rails module will be hidden by Doorkeeper::Rails and only accessible as ::Rails

I created a minimal project to highlight the issue; it is a minimal rails app with added devise-doorkeeper and minimal configurations for devise, doorkeeper and devise-doorkeeper. The only created test will highlight the error alternatively simply open a console and invoke User.new.rails_version:

Loading development environment (Rails 6.1.4.1)
3.0.2 :001 > User.new.rails_version
   (1.7ms)  SELECT sqlite_version(*)
/Users/username/Development/devise-doorkeeper-classloading-issue/app/models/user.rb:6:in `rails_version': undefined method `version' for Doorkeeper::Rails:Module (NoMethodError)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions