From 949a740ccae957a1d2b46cecde12a6598110842b Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 12 Sep 2024 15:38:25 +0200 Subject: [PATCH 1/3] Add eager loading to staging --- config/environments/staging.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 72dbee485f..70cf8e1ce4 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -23,8 +23,8 @@ # since you don't have to restart the web server when you make code changes. config.cache_classes = false - # Do not eager load code on boot. - config.eager_load = false + # Eager load code on boot. + config.eager_load = true # Show full error reports. config.consider_all_requests_local = true From 5e18d8814e5fca068f71d22dc1b5902e0f82a733 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 12 Sep 2024 15:54:44 +0200 Subject: [PATCH 2/3] Don't autoload lib --- config/application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 5cd9e6800a..34cfca3691 100644 --- a/config/application.rb +++ b/config/application.rb @@ -16,7 +16,7 @@ class Application < Rails::Application # Please, add to the `ignore` list any other `lib` subdirectories that do # not contain `.rb` files, or that should not be reloaded or eager loaded. # Common ones are `templates`, `generators`, or `middleware`, for example. - config.autoload_lib(ignore: %w[assets tasks]) + # config.autoload_lib(ignore: %w[assets tasks]) # Configuration for the application, engines, and railties goes here. # From 3cbdb0514b8d50a12d005a02d925ac9f9f839c06 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Thu, 12 Sep 2024 16:01:22 +0200 Subject: [PATCH 3/3] Update comment --- config/application.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/application.rb b/config/application.rb index 34cfca3691..e31ed459cf 100644 --- a/config/application.rb +++ b/config/application.rb @@ -13,9 +13,7 @@ class Application < Rails::Application config.dodona_email = 'dodona@ugent.be' - # Please, add to the `ignore` list any other `lib` subdirectories that do - # not contain `.rb` files, or that should not be reloaded or eager loaded. - # Common ones are `templates`, `generators`, or `middleware`, for example. + # Don't eager load the lib directory, this causes issues with the autoloader # config.autoload_lib(ignore: %w[assets tasks]) # Configuration for the application, engines, and railties goes here.