Skip to content

Commit

Permalink
Fix Broadcastable inclusion in new Rails apps
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjensen committed Sep 18, 2024
1 parent fa4b60a commit a38445e
Show file tree
Hide file tree
Showing 2 changed files with 220 additions and 226 deletions.
10 changes: 5 additions & 5 deletions lib/turbo/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ class Engine < Rails::Engine
end

initializer "turbo.broadcastable" do
ActiveSupport.on_load(:active_job) do
ActiveSupport.on_load(:active_record) do
ActiveSupport.on_load(:active_record) do
if defined?(ActiveJob)
include Turbo::Broadcastable
end
end
Expand Down Expand Up @@ -123,9 +123,9 @@ class Engine < Rails::Engine
include Turbo::TestAssertions
end

ActiveSupport.on_load(:active_job) do
ActiveSupport.on_load(:action_cable) do
ActiveSupport.on_load(:active_support_test_case) do
ActiveSupport.on_load(:action_cable) do
ActiveSupport.on_load(:active_support_test_case) do
if defined?(ActiveJob)
require "turbo/broadcastable/test_helper"
include Turbo::Broadcastable::TestHelper
end
Expand Down
Loading

0 comments on commit a38445e

Please sign in to comment.