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

Clear query cache when insert all is used #37154

Merged
merged 1 commit into from
Sep 9, 2019

Conversation

eugeneius
Copy link
Member

Fixes #37142.

The InsertAll class currently calls exec_query, which doesn't give the query cache enough information to know that it needs to be cleared.

By adding an exec_insert_all method that calls exec_query internally we can configure the query cache to clear when that method is called.

The `InsertAll` class currently calls `exec_query`, which doesn't give
the query cache enough information to know that it needs to be cleared.

By adding an `exec_insert_all` method that calls `exec_query` internally
we can configure the query cache to clear when that method is called.
@kamipo kamipo merged commit 692145e into rails:master Sep 9, 2019
kamipo added a commit that referenced this pull request Sep 9, 2019
Clear query cache when insert all is used
suketa added a commit to suketa/rails_sandbox that referenced this pull request Mar 22, 2020
Clear query cache when insert all is used
rails/rails#37154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ActiveRecord::Persistence#upsert_all does not clear query cache.
2 participants