I noticed that Tag#tagnames_as_classes performs a Node.find(id) call,
which can lead to N+1 queries when rendering tag lists.
Since Tag already has a node association, this can be rewritten to
use the association and allow eager loading with .includes(:node).
This would improve performance without changing behavior.
I’d like to work on this if that’s okay.
I noticed that
Tag#tagnames_as_classesperforms aNode.find(id)call,which can lead to N+1 queries when rendering tag lists.
Since
Tagalready has anodeassociation, this can be rewritten touse the association and allow eager loading with
.includes(:node).This would improve performance without changing behavior.
I’d like to work on this if that’s okay.