From fb3267dbc6c6b95c99cfa7f1a5cc082bc1c6a1db Mon Sep 17 00:00:00 2001 From: Mike Heft Date: Mon, 8 Jul 2024 12:21:48 -0600 Subject: [PATCH] try loading in different dir --- config/application.rb | 5 ++--- {app => lib}/middleware/error_handler.rb | 0 2 files changed, 2 insertions(+), 3 deletions(-) rename {app => lib}/middleware/error_handler.rb (100%) diff --git a/config/application.rb b/config/application.rb index c58d271..f109a58 100644 --- a/config/application.rb +++ b/config/application.rb @@ -18,7 +18,7 @@ # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) -require_relative "../app/middleware/error_handler" +require_relative "../lib/middleware/error_handler" module RouteRater class Application < Rails::Application @@ -31,8 +31,7 @@ class Application < Rails::Application config.autoload_lib(ignore: %w(assets tasks)) config.autoload_paths << Rails.root.join('lib') config.autoload_paths += %W(#{config.root}/lib) - config.autoload_paths << "#{Rails.root}/app/middleware" - config.eager_load_paths << "#{Rails.root}/app/middleware" + config.middleware.use Middleware::ErrorHandler # Configuration for the application, engines, and railties goes here. diff --git a/app/middleware/error_handler.rb b/lib/middleware/error_handler.rb similarity index 100% rename from app/middleware/error_handler.rb rename to lib/middleware/error_handler.rb