diff --git a/actioncable/lib/action_cable.rb b/actioncable/lib/action_cable.rb index b0f605095dda1..1c5ade49824fa 100644 --- a/actioncable/lib/action_cable.rb +++ b/actioncable/lib/action_cable.rb @@ -29,8 +29,21 @@ Zeitwerk::Loader.for_gem.tap do |loader| loader.ignore( - "#{__dir__}/rails", # Contains generators, templates, docs, etc. + # Contains generators, templates, docs, etc. + "#{__dir__}/rails", + + # These two files set things up in a special way. + # + # action_cable/gem_version.rb is not autoloadable, because it does not + # define the expected constant. action_cable/version.rb is, but in an + # indirect way. + # + # We could configure the autoloader accordingly, but loading the files + # manually makes you think less. "#{__dir__}/action_cable/gem_version.rb", + "#{__dir__}/action_cable/version.rb", + + # Defines Rails.deprecator, which is not autoloadable. "#{__dir__}/action_cable/deprecator.rb", ) @@ -46,6 +59,7 @@ # :markup: markdown # :include: ../README.md module ActionCable + require_relative "action_cable/gem_version" require_relative "action_cable/version" require_relative "action_cable/deprecator"