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 class duplication bug with reloads #450

Merged
merged 2 commits into from
Nov 16, 2021

Conversation

jaredcwhite
Copy link
Member

This fixes a nasty bug where classes were being duplicated in dev with Zeitwerk reloads and ActiveSupport::DescendantsTracker. So for example you'd have a Post subclass of Bridgetown::Model::Base, and you'd reload, and now you'd have two Posts, reload again, and you'd have three Posts, etc. Argh. Now descendant classes are specifically removed from the descendants tree upon unload.

@render
Copy link

render bot commented Nov 16, 2021

@render
Copy link

render bot commented Nov 16, 2021

@jaredcwhite jaredcwhite merged commit 0c97795 into main Nov 16, 2021
@jaredcwhite jaredcwhite deleted the fix-reloads-and-descendants-tracker branch November 16, 2021 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant