File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,16 @@ class Engine < ::Rails::Engine
2626 #{ root } /app/jobs
2727 ]
2828
29+ # If the parent application does not use Action Cable, app/channels cannot
30+ # be eager loaded, because it references the ActionCable constant.
31+ # This approach was ported from the amazing folks at turbo-rails
32+ # You can find its MIT License here: https://github.com/hotwired/turbo-rails/blob/main/MIT-LICENSE
33+ initializer :"superglue.no_action_cable" , before : :set_eager_load_paths do
34+ unless defined? ( ActionCable )
35+ Rails . autoloaders . once . do_not_eager_load ( "#{ root } /app/channels" )
36+ end
37+ end
38+
2939 initializer :superglue do |app |
3040 ActiveSupport . on_load ( :action_controller ) do
3141 next if self != ActionController ::Base
You can’t perform that action at this time.
0 commit comments