Simplify code to autoload paths

This we'll simplify adding these same paths to `eager_load_paths` when
switching to Zeitwerk.
This commit is contained in:
Javi Martín
2024-03-17 21:30:22 +01:00
parent cb477149c4
commit 7d02f0933d

View File

@@ -132,12 +132,17 @@ module Consul
# * English: https://github.com/consuldemocracy/consuldemocracy/blob/master/CUSTOMIZE_EN.md
# * Spanish: https://github.com/consuldemocracy/consuldemocracy/blob/master/CUSTOMIZE_ES.md
#
config.autoload_paths << "#{Rails.root}/app/components/custom"
config.autoload_paths << "#{Rails.root}/app/controllers/custom"
config.autoload_paths << "#{Rails.root}/app/graphql/custom"
config.autoload_paths << "#{Rails.root}/app/mailers/custom"
config.autoload_paths << "#{Rails.root}/app/models/custom"
config.autoload_paths << "#{Rails.root}/app/models/custom/concerns"
[
"app/components/custom",
"app/controllers/custom",
"app/graphql/custom",
"app/mailers/custom",
"app/models/custom",
"app/models/custom/concerns"
].each do |path|
config.autoload_paths << Rails.root.join(path)
end
config.paths["app/views"].unshift(Rails.root.join("app", "views", "custom"))