Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed N+1 on product edit form

Damian Legawiec63d6163ae2f1
diff --git a/admin/app/helpers/spree/admin/products_helper.rb b/admin/app/helpers/spree/admin/products_helper.rb
index ebdc351d30..eae5f696c6 100644
--- a/admin/app/helpers/spree/admin/products_helper.rb
+++ b/admin/app/helpers/spree/admin/products_helper.rb
@@ -124,7 +124,7 @@ module Spree
end
def sorted_product_properties(product)
- product.product_properties.sort_by { |product_property| product_property.property.position }
+ product.product_properties.includes(:property).sort_by { |product_property| product_property.property.position }
end
end
end