diff --git a/app/models/procedure.rb b/app/models/procedure.rb index a2912b7b6..3a6c9e652 100644 --- a/app/models/procedure.rb +++ b/app/models/procedure.rb @@ -43,7 +43,6 @@ # published_revision_id :bigint # service_id :bigint # -require Rails.root.join('lib', 'percentile') class Procedure < ApplicationRecord self.ignored_columns = ['archived_at', 'csv_export_queued', 'xlsx_export_queued', 'ods_export_queued'] diff --git a/config/application.rb b/config/application.rb index cc8508f4f..ab6c2cf5e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,9 +17,10 @@ module TPS # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. - # The default autoloader since Rails 6.0 defaults is zeitwerk. - # However, to split the work, we will move to zeitwerk only in a future PR. - config.autoloader = :classic + Rails.autoloaders.main.ignore(Rails.root.join('lib/cops')) + Rails.autoloaders.main.ignore(Rails.root.join('lib/linters')) + Rails.autoloaders.main.ignore(Rails.root.join('lib/tasks/task_helper.rb')) + config.paths.add Rails.root.join('spec/mailers/previews').to_s, eager_load: true # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. diff --git a/config/initializers/core_ext.rb b/config/initializers/core_ext.rb new file mode 100644 index 000000000..99b320fcd --- /dev/null +++ b/config/initializers/core_ext.rb @@ -0,0 +1,3 @@ +Dir[File.join(Rails.root, "lib", "core_ext", "*.rb")].each do |core_ext_file| + require core_ext_file +end diff --git a/lib/percentile.rb b/lib/core_ext/array.rb similarity index 100% rename from lib/percentile.rb rename to lib/core_ext/array.rb