Skip to content

Commit 8d41d67

Browse files
committedJan 11, 2024
Merge pull request #50715 from maximerety/lazy-load-active-job-when-using-test-helper
[Fix #50713] Do not trigger loading of ActiveJob::Base in ActiveJob::TestHelper
1 parent 1c90604 commit 8d41d67

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎activejob/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Do not trigger immediate loading of `ActiveJob::Base` when loading `ActiveJob::TestHelper`.
2+
3+
*Maxime Réty*
4+
15
* Preserve the serialized timezone when deserializing `ActiveSupport::TimeWithZone` arguments.
26

37
*Joshua Young*

‎activejob/lib/active_job/test_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ def enable_test_adapter(test_adapter)
3434
end
3535
end
3636

37-
ActiveJob::Base.include(TestQueueAdapter)
37+
ActiveSupport.on_load(:active_job) do
38+
ActiveJob::Base.include(TestQueueAdapter)
39+
end
3840

3941
def before_setup # :nodoc:
4042
test_adapter = queue_adapter_for_test

0 commit comments

Comments
 (0)
Please sign in to comment.