Use Zeitwerk instead of the classic autoloader

In Rails 6.1, the classic autoloader is deprecated.

We were getting an error because we were using `autoload` in the
ActiveStorage plugin for CKEditor:

expected file app/lib/ckeditor/backend/active_storage.rb to define
constant Ckeditor::Backend::ActiveStorage

So we're removing the line causing the error.

Finally, we can now restore all the tests that that failed sometimes
with the classic autoloader and that we modified in commits 2af1fc72f
and 8ba37b295.
This commit is contained in:
Javi Martín
2023-07-25 04:46:53 +02:00
parent 004684efe6
commit 5f24ee9121
6 changed files with 33 additions and 42 deletions

View File

@@ -32,10 +32,6 @@ module Consul
# in any CONSUL DEMOCRACY installations
config.active_support.use_authenticated_message_encryption = false
# Keep using the classic autoloader until we decide how custom classes
# should work with zeitwerk
config.autoloader = :classic
# Don't enable has_many_inversing because it doesn't seem to currently
# work with the _count database columns we use for caching purposes
config.active_record.has_many_inversing = false
@@ -143,6 +139,7 @@ module Consul
"app/models/custom/concerns"
].each do |path|
config.autoload_paths << Rails.root.join(path)
config.eager_load_paths << Rails.root.join(path)
end
config.paths["app/views"].unshift(Rails.root.join("app", "views", "custom"))