Allow cleaning backtraces used to identify N+1 queries #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some gems cache missing methods after the first call. This can cause Prosopite to miss duplicate queries. For example, the N+1 query for
author
in the followingbuilder
template goes unnoticed if there are two posts sincexml.post
is a missing method that gets cached for the second call (see [1]).Add
location_backtrace_cleaner
config option to modify backtraces that are used to identify queries. This allows to either silence problematic lines or even just use the backtrace inside the application itself:[1] https://github.com/jimweirich/builder/blob/c80100f8205b2e918dbff605682b01ab0fabb866/lib/builder/xmlbase.rb#L91