From 02bbb5071482cab8c91b956d2f6437b4cded3cce Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Thu, 10 Jun 2021 11:47:31 +1000 Subject: [PATCH] Remove indices from eager load paths. This is perhaps only an issue with the classic autoloader, but it makes sense for the change to happen either way. This fix hopefully resolves #1191 and #1195, and was possible due to debugging assistance from @atomical and @thebravoman. --- lib/thinking_sphinx/railtie.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/thinking_sphinx/railtie.rb b/lib/thinking_sphinx/railtie.rb index bc9efd36..22054e10 100644 --- a/lib/thinking_sphinx/railtie.rb +++ b/lib/thinking_sphinx/railtie.rb @@ -17,6 +17,11 @@ class ThinkingSphinx::Railtie < Rails::Railtie Rails.root.join("app", "indices").to_s ) end + + Rails.application.config.eager_load_paths -= [ + Rails.root.join("app", "indices").to_s + ] + Rails.application.config.eager_load_paths.freeze end end