From 8c8fd2ab75ccb751eaa312ae97b1a2ce23161c21 Mon Sep 17 00:00:00 2001 From: Adam Kiczula Date: Thu, 8 Feb 2024 13:15:38 -0600 Subject: [PATCH] fix: add railtie to clear cache after class changes --- lib/jsonapi/resources/railtie.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/jsonapi/resources/railtie.rb b/lib/jsonapi/resources/railtie.rb index 920e88b1..7074aba0 100644 --- a/lib/jsonapi/resources/railtie.rb +++ b/lib/jsonapi/resources/railtie.rb @@ -26,6 +26,10 @@ class Railtie < ::Rails::Railtie 'by setting `warn_on_eager_loading_disabled` to false.' end end + config.to_prepare do + ::JSONAPI::Resource._clear_resource_type_to_klass_cache + ::JSONAPI::Resource._clear_model_to_resource_type_cache + end end end end