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

Do not load ActiveJobs if ActiveJob is not loaded #602

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aaronjensen
Copy link
Contributor

Fixes #478

Replaces #479

Based on #601

# end
#
initializer "turbo.no_active_job", before: :set_eager_load_paths do
unless defined?(ActiveJob)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this work instead?

ActiveSupport.on_load :active_job do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know. I'm following the pattern used in the Action Cable check below. At first blush, it seems preferable to the method used here, but it would need to be tested.

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct, sorry I was thinking of the opposite case but this initializer occurs in the absence of AJ 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

active_job must be required
2 participants