Eager load taggings related to variant overrides

This removes an N+1 with taggings but doesn't solve the one with tags.
Using `includes(taggings: :base_tags)` based on
47da5036de/lib/acts_as_taggable_on/taggable.rb (L83-L84)
wasn't enough to solve it and I got to stop here. This is scope-creeping
too much.
This commit is contained in:
Pau Perez
2021-02-01 14:43:31 +01:00
parent ee4f2a7b02
commit 0ee1e2cd72

View File

@@ -75,6 +75,7 @@ module Admin
def collection
@variant_overrides = VariantOverride.
includes(:taggings).
joins(variant: :product).
preload(variant: :product).
for_hubs(params[:hub_id] || @hubs)