-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
The owner association doesn't come through when subclassing Doorkeeper::Application with custom model #1455
Comments
FWIW, my Rails app is open source, I've created a branch exemplifying this issue here: https://github.com/connorshea/vglist/tree/doorkeeper-issue-example Sorry for all the noise with Sorbet and such, I've tried to keep it in its own separate commit so it doesn't cause problems with trying to understand what's changing in any given commit. |
Cloned your repo @connorshea , saw the issue. Relates to some Rails autoloading or constant resolution I think, because while debugging I found that |
Steps to reproduce
application_class
in thedoorkeeper.rb
config:And then run the specs for the application.
Expected behavior
The specs should pass and not print any deprecation warnings.
Actual behavior
I get a deprecation warning about constant autoloading when running my RSpec tests, though oddly not when running the server?
(FWIW, the line at environment.rb:6 is
Rails.application.initialize!
)But the main issue is that I have problems with setting or accessing the
owner
association on instances of OauthApplication.If I had to make a guess, I think it might be because the models are hardcoded here?:
doorkeeper/lib/doorkeeper/orm/active_record.rb
Lines 52 to 58 in b8abbe6
I would think that - since my OauthApplication model is a subclass of Doorkeeper::Application - it would also have the owner relationship on the subclass, but apparently not.
System configuration
Doorkeeper initializer:
Ruby version:
2.6.6
Gemfile.lock:
Gemfile.lock content
The text was updated successfully, but these errors were encountered: