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

Incompatible with delayed_job_active_record v1.4.5 #27

Closed
f-mer opened this issue Dec 10, 2020 · 5 comments
Closed

Incompatible with delayed_job_active_record v1.4.5 #27

f-mer opened this issue Dec 10, 2020 · 5 comments

Comments

@f-mer
Copy link
Contributor

f-mer commented Dec 10, 2020

In version v1.4.5 of delayed_job_active_record the loading of Delayed::Backend::ActiveRecord::Job was moved into a railtie which requires it now after initialization. This blows up in delayed_cron_job.rb:27 because require 'delayed_job_active_record' does not load Delayed::Backend::ActiveRecord::Job.

The reasoning behind this change is documented in collectiveidea/delayed_job_active_record#172.

@codez
Copy link
Owner

codez commented Dec 10, 2020

Thank you for your fast notification of the issue. With those detailed debug hints, it was an easy way to fix this issue. Do you have time for a quick test on your side, based on #28?

@f-mer
Copy link
Contributor Author

f-mer commented Dec 10, 2020

Hello @codez that was quick, thanks 😃 I just ran into this while upgrading an application to Rails 6.1. and thought it would be helpful to leaf a note. No pressure on my side.

For this to work the after_initialize callback registered by delayed_job_active_record must be triggered before the one registered by delayed_cron_job or? My wild guess is that there could be a scenario where this would fail 🤔

@nevesenin
Copy link

Works great. Thank you.

@codez
Copy link
Owner

codez commented Dec 11, 2020

By requiring delayed_job_active_record first in delayed_cron_job.rb, the callback should also be registered first. So everything should be in the correct order.

@codez codez closed this as completed in 4d1c74e Dec 11, 2020
@codez
Copy link
Owner

codez commented Dec 11, 2020

A new version of the gem is released.

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

3 participants