Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add railtie to clear caches when code reloads #1448

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/jsonapi/resources/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class Railtie < ::Rails::Railtie
'by setting `warn_on_eager_loading_disabled` to false.'
end
end
config.to_prepare do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noting that this is related to the same issue we were trying to address in #1440 and #1434

::JSONAPI::Resource._clear_resource_type_to_klass_cache
::JSONAPI::Resource._clear_model_to_resource_type_cache
end
end
end
end
Loading