Don't auto-preload AGAIN during nested renders #16
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.
Fixing an issue with
auto
and nested renders. Whenauto
was on, nested associations were RE-preloading their subtrees. In many cases this was only a minor issue. But in certain situations (lots of manual preloads + field blocks that were really associations), it was a huge net loss of performance.This is fixed by stricter matching in the extension. Preloading now only occurs if the rendered object's class is exactly
ActiveRecord::Relation
orActiveRecord::AssociationRelation
. Subclasses likeActiveRecord::Associations::CollectionProxy
will no longer match, ensuring we don't preload on nested associations.Since this is a significant issue, I've included a version bump so we can release asap. Also enabled appraisal in GH Actions.