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.
Attempted fix for Can't avoid under/overfetching
Hey @pablobm - I took your suggestion from point 1 here and ran it a little further to get the tests passing.
attribute_includes
to restrict eager loading to BelongsTo and HasOne association fieldsitem_associations
andattribute_associated
methods with the old behaviour so thatsanitized_order_params
in ApplicationHelper still works correctly - it was needed to fix a few specs I think related to column sorting.Old request logs from the test app (excluding renders):
Same request, with these changes:
This change converted the log_entries from an eager load to just a count. The orders association would also have converted, except that there's that silly
lifetime_value
calculation that does some manual math on the orders, so it gets loaded in for that anyway (and is its own N+1 problem, but that's not Administrate's fault).