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: Eager-loaded models will not register after_commit callback #38

Merged
merged 11 commits into from
Jun 7, 2018

Conversation

khiav223577
Copy link
Owner

Rails will eager loading all the models In production, and do not fire ActiveSupport::Dependencies.onload events. This causes after_commit not being registered.

This PR fixes this issue by register only one after_commit in ActiveRecord::Base, and maintaining all the callbacks manually in a hash table.

@khiav223577 khiav223577 merged commit c9d1863 into master Jun 7, 2018
@khiav223577 khiav223577 deleted the fix/eager_loaded_class branch June 7, 2018 14:28
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