-
Notifications
You must be signed in to change notification settings - Fork 8
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
Defer include until after initialization as that is when delayed_job_… #18
Conversation
…active_record now instantiates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! A few small suggestions but otherwise looks great.
…pdate to use Ruby 2.5 include method. RuboCop!
…to use ruby 2.5 include
I apologize for the delay. I have made all of the requested updates. Thanks for your thoughtful comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes. Just one more thing I noticed on re-review.
@@ -11,6 +11,15 @@ | |||
require 'delayed/job_groups/yaml_loader' | |||
require 'delayed/job_groups/version' | |||
|
|||
Delayed::Backend::ActiveRecord::Job.send(:include, Delayed::JobGroups::JobExtensions) | |||
if defined?(Delayed::Backend::ActiveRecord) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gem has a dependency on delayed_job_active_record so won't the Delayed::Backend::ActiveRecord
constant always be defined? Seems like this conditional could mask other issues and cause the gem to silently not load properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are very likely correct. I was following the pattern from the delayed_cron gem and didn't investigate why they required that check. Seems having it fail at load makes more sense than having it fail later when an attempt is made to use the group function. I will remove that if statement wrapper.
@hoenth any plans to revisit this? I'd love to see it merged! |
@hoenth Thanks for this contribution! |
…active_record now instantiates.
This follows the pattern used by delayed_cron_job gem ( codez/delayed_cron_job#27) to make delayed_job_groups_plugin compatible with delayed_job_active_record v1.4.5