Commit 32114bb702984fac6fa131792859a3b9dd0c7b38
1 parent
0e7bcb08
Exists in
master
and in
5 other branches
Added comment [skip ci]
Showing
1 changed file
with
1 additions
and
0 deletions
Show diff stats
lib/tasks/searchkick.rake
@@ -16,6 +16,7 @@ namespace :searchkick do | @@ -16,6 +16,7 @@ namespace :searchkick do | ||
16 | namespace :reindex do | 16 | namespace :reindex do |
17 | desc "reindex all models" | 17 | desc "reindex all models" |
18 | task all: :environment do | 18 | task all: :environment do |
19 | + # eager load models to populate Searchkick.models | ||
19 | if Rails.respond_to?(:autoloaders) && Rails.autoloaders.zeitwerk_enabled? | 20 | if Rails.respond_to?(:autoloaders) && Rails.autoloaders.zeitwerk_enabled? |
20 | # fix for https://github.com/rails/rails/issues/37006 | 21 | # fix for https://github.com/rails/rails/issues/37006 |
21 | Zeitwerk::Loader.eager_load_all | 22 | Zeitwerk::Loader.eager_load_all |