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

undefined method `config' for Doorkeeper:Module #59

Open
kitop opened this issue Aug 19, 2020 · 1 comment
Open

undefined method `config' for Doorkeeper:Module #59

kitop opened this issue Aug 19, 2020 · 1 comment

Comments

@kitop
Copy link

kitop commented Aug 19, 2020

Steps to reproduce

I'm upgrading an app that was in Doorkeeper 5.0 with doorkeeper-mongodb 5.0, to 5.2 of each (had to skip 5.1 due to #37)

When running tests, some of them fail with undefined method 'config' for Doorkeeper:Module

In particular, this line:

Doorkeeper::AccessGrant.create!(application_id: app.id, resource_owner_id: user.id, redirect_uri: "http://example.com", expires_in: 1.day)

While looking a bit more, I found this:
https://github.com/doorkeeper-gem/doorkeeper-mongodb/blob/v5.2.2/lib/doorkeeper-mongodb/mixins/mongoid/access_grant_mixin.rb#L139-L141

That is calling Doorkeeper.config that doesn't seem to be available in Doorkeeper 5.2.
The same class calls Doorkeeper.configuration in another part:
https://github.com/doorkeeper-gem/doorkeeper-mongodb/blob/v5.2.2/lib/doorkeeper-mongodb/mixins/mongoid/access_grant_mixin.rb#L35

This is breaking the application, and not allowing to do minor version upgrades of Doorkeeper. I would like to avoid jumping from 5.0 to 5.3+ if possible.

Expected behavior

doorkeeper-mongodb 5.2 specifies in the gemspec that it needs doorkeeper >= 5.2, but it's not working with 5.2.

gem.add_dependency "doorkeeper", ">= 5.2", "< 6.0"

I'd expect to either have a 5.1 or similar release that works both with doorkeeper 5.1 and 5.2 or somehow fix the versioning to work accordingly.

Actual behavior

doorkeeper-mongodb 5.2 doesn't work with doorkeeper 5.2

System configuration

Ruby version: 2.5.8
Gemfile.lock

    doorkeeper (5.2.6)
      railties (>= 5)
    doorkeeper-mongodb (5.2.2)
      doorkeeper (>= 5.2, < 6.0)
@johnnyshields
Copy link

johnnyshields commented Jun 25, 2022

@kitop thanks for reporting this issue. Unfortunately, Given that Doorkeeper is now on v5.5.4 and this was some time ago, I think users in this situation must either monkey-patch the code (alias configuration method) or just do the big-bang upgrade.

@nbulaj this issue can be closed, but please be mindful of user upgrade continuity for future releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants