-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
NameError: uninitialized constant ApplicationRecord if having two subtask for DB query #157
Comments
Do you think it's load issue? make something wrong with Zeitwerk. Can you try adding |
Can you reproduce with the |
We also run across this issue with any class that we use in subtasks. Only on the first request, the second request will have the class loaded. |
Commenting out the |
We have some issues with autoloading in Ruby 3.1.1 and I will try to back port a fix for Ruby 3.1.2 if possible. A solution is to disable autoloading where possible. |
I'm proposing a fix here ruby/ruby#5788 |
This bug is fixed and will be released in Ruby 3.2. Sorry about that and thanks for your patience. If you want to help further, please retry your test case with the latest async on Ruby head. |
Causes an issue in Ruby < 3.2: socketry/async#157
Given that ged/ruby-pg#397 is merged, I'm trying to use the
async
gem with latestruby-pg
in Rails 7. However, it seems that I could not use a database connection to two separated subtasks.Here is the example:
Error log
app/models/post.rb
app/models/user.rb
app/controllers/application_controller.rb
Gemfile
Gemfile.lock
Notes
If I change them in one subtask, it will work well.
app/controllers/application_controller.rb
The text was updated successfully, but these errors were encountered: