mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-07 22:46:06 +00:00
Eager load variants with variant overrides to avoid n+1 in the following line
This commit is contained in:
@@ -76,7 +76,7 @@ module Admin
|
||||
end
|
||||
|
||||
def collection
|
||||
@variant_overrides = VariantOverride.for_hubs(params[:hub_id] || @hubs)
|
||||
@variant_overrides = VariantOverride.includes(:variant).for_hubs(params[:hub_id] || @hubs)
|
||||
@variant_overrides.select { |vo| vo.variant.present? }
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user