doorkeeper-mongodb
doorkeeper-mongodb copied to clipboard
undefined method `config' for Doorkeeper:Module
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 https://github.com/doorkeeper-gem/doorkeeper-mongodb/issues/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.
https://github.com/doorkeeper-gem/doorkeeper-mongodb/blob/1d2f1d5cb808f720123a6125d8239c0316b7a10c/doorkeeper-mongodb.gemspec#L22
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)