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.

Change `includes` to `preload` in Spree::Admin::ImagesController

Damian Kaczmarczyk9cca7c397d56
diff --git a/backend/app/controllers/spree/admin/images_controller.rb b/backend/app/controllers/spree/admin/images_controller.rb
index 37d4448b2a..7d8ffb2c6b 100644
--- a/backend/app/controllers/spree/admin/images_controller.rb
+++ b/backend/app/controllers/spree/admin/images_controller.rb
@@ -18,11 +18,11 @@ module Spree
end
def load_index_data
- @product = Product.friendly.includes(*variant_index_includes).find(params[:product_id])
+ @product = Product.friendly.preload(*variant_index_includes).find(params[:product_id])
end
def load_edit_data
- @product = Product.friendly.includes(*variant_edit_includes).find(params[:product_id])
+ @product = Product.friendly.preload(*variant_edit_includes).find(params[:product_id])
@variants = @product.variants.map do |variant|
[variant.sku_and_options_text, variant.id]
end