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

Avoid forcing applications to have a root ApplicationJob defined #70

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

alxckn
Copy link
Contributor

@alxckn alxckn commented Feb 17, 2024

While trying out mission control in an existing application, I encountered some errors whose origin is the fact that there is no root ApplicationJob.

Mission control defines its own MissionControl::Jobs::ApplicationJob, however it doesn't seem to be used due to how each files' class is defined:

module MissionControl::Jobs::FailedJobsBulkOperations
  def bulk_limited_filtered_failed_jobs
      ApplicationJob.jobs # would work with MissionControl::Jobs::FailedJobsBulkOperations::ApplicationJob or ::ApplicationJob
    end
end

This is a proposal to use ActiveJob::Base in application code instead so it is compatible with applications that don't have a root ApplicationJob. Furthermore, this removes the unused MissionControl::Jobs::ApplicationJob.

Also remove unused MissionControl::Jobs::ApplicationJob
Copy link
Member

@rosa rosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thanks @alxckn! I think I'm going to take this a bit further and replace ActiveJob::Base.jobs with ActiveJob.jobs, to be consistent everywhere.

@rosa rosa merged commit 609c895 into rails:main Feb 22, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants