mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user