Skip to content

Commit

Permalink
Enable 7.2 defaults and autloading of lib
Browse files Browse the repository at this point in the history
Rails 3.0 changed how library loading works, and Zeitwerk rigidly enforces
this standard. So we now autoload the lib directory with the others.
  • Loading branch information
Tetrino committed Dec 3, 2024
1 parent 8980207 commit 5d9eddb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,15 @@ class Application < Rails::Application
include GovukPublishingComponents::AppHelpers::AssetHelper

# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
config.load_defaults 7.2
config.govuk_time_zone = "London"

# Prevents an initialisation error in Zeitwerk, initialisation changed as flagged by this comment
# in the Rails repo https://github.com/rails/rails/issues/37835#issuecomment-560563560
config.autoload_paths += [
Rails.root.join("lib"),
]

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
Expand Down

0 comments on commit 5d9eddb

Please sign in to comment.