From 090c6427c23e5c1bd0d3e1d01e0f252f7e868666 Mon Sep 17 00:00:00 2001 From: Martin Meyerhoff Date: Tue, 14 Jan 2025 15:01:41 +0100 Subject: [PATCH] Delay patch finding to before `:eager_load!` Currently, the Flickwerk initializers run at some time, and that works. However, by fixing them to `before: :eager_load!`, we make sure they run late enough to know all about all inflections. --- lib/flickwerk/railtie.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/flickwerk/railtie.rb b/lib/flickwerk/railtie.rb index a423ead..c064ff5 100644 --- a/lib/flickwerk/railtie.rb +++ b/lib/flickwerk/railtie.rb @@ -5,7 +5,7 @@ require "rails/railtie" class Flickwerk::Railtie < Rails::Railtie - initializer "flickwerk.find_patches" do |app| + initializer "flickwerk.find_patches", before: :eager_load! do |app| app.reloader.to_prepare do Flickwerk.patch_paths.each do |path| Flickwerk::PatchFinder.new(path).call