Skip to content

Commit 713864f

Browse files
committed
Fix breaking in non-Zeitwerk environment
Change the implementation to support both Zeitwerk and the classic autoloader
1 parent 2a2a5ec commit 713864f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/turbo/engine.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Engine < Rails::Engine
1616
#{root}/app/jobs
1717
)
1818

19-
initializer "turbo.no_action_cable" do
20-
Rails.autoloaders.once.do_not_eager_load(Dir["#{root}/app/channels/turbo/*_channel.rb"]) unless defined?(ActionCable)
19+
initializer "turbo.no_action_cable", before: :set_eager_load_paths do
20+
config.eager_load_paths.delete("#{root}/app/channels") unless defined?(ActionCable)
2121
end
2222

2323
# If you don't want to precompile Turbo's assets (eg. because you're using webpack),

0 commit comments

Comments
 (0)