mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Render enterprise rows as a collection
Note: this is a bit like an N+1 query, but for rendering. If there are 30 enterprises, the partial file would be loaded and parsed 30 times; but if we render it as a collection it'll load the partial once and substantially improve the performance.
This commit is contained in:
@@ -25,8 +25,7 @@
|
||||
%span.centered.three.columns
|
||||
= t "spree_admin_enterprises_fees"
|
||||
%div.sixteen.columns.alpha.list
|
||||
- @enterprises.each do |enterprise|
|
||||
= render 'enterprise_row', { enterprise: enterprise }
|
||||
= render partial: 'enterprise_row', collection: @enterprises, as: :enterprise
|
||||
|
||||
%a.sixteen.columns.alpha.button.bottom.blue{ href: "#{main_app.admin_enterprises_path}" }
|
||||
= t "spree_admin_overview_enterprises_footer"
|
||||
|
||||
Reference in New Issue
Block a user