From 8f8dd7e72100f0a8d14f4a45ef0508444ff5c686 Mon Sep 17 00:00:00 2001 From: Jonathan Rochkind Date: Wed, 26 Jan 2022 16:19:29 -0500 Subject: [PATCH] wrap initialization in reloader.to_prepare to avoid autoload deprecation warning in some cases --- config/initializers/authorities.rb | 4 +++- config/initializers/linked_data_authorities.rb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/initializers/authorities.rb b/config/initializers/authorities.rb index a7f4e375..f6a874e9 100644 --- a/config/initializers/authorities.rb +++ b/config/initializers/authorities.rb @@ -1 +1,3 @@ -Qa::Authorities::Local.load_config(File.expand_path("../../authorities.yml", __FILE__)) +Rails.application.reloader.to_prepare do + Qa::Authorities::Local.load_config(File.expand_path("../../authorities.yml", __FILE__)) +end diff --git a/config/initializers/linked_data_authorities.rb b/config/initializers/linked_data_authorities.rb index 15dd5043..12303607 100644 --- a/config/initializers/linked_data_authorities.rb +++ b/config/initializers/linked_data_authorities.rb @@ -1 +1,3 @@ -Qa::LinkedData::AuthorityService.load_authorities +Rails.application.reloader.to_prepare do + Qa::LinkedData::AuthorityService.load_authorities +end