Merge pull request #5899 from betagouv/zeitwerk
Utilisation de zeitwerk, l'auto-loader de Rails 6 (#5887, #5899)
This commit is contained in:
commit
3530f4ef6a
4 changed files with 7 additions and 4 deletions
|
@ -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']
|
||||
|
|
|
@ -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.
|
||||
|
|
3
config/initializers/core_ext.rb
Normal file
3
config/initializers/core_ext.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
Dir[File.join(Rails.root, "lib", "core_ext", "*.rb")].each do |core_ext_file|
|
||||
require core_ext_file
|
||||
end
|
Loading…
Reference in a new issue