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 Admin Countries AP N+1s

Damian Legawiec06e52cd3a069
diff --git a/spree/api/app/controllers/spree/api/v3/admin/countries_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/countries_controller.rb
index a89652537a..2bdd9a1e6f 100644
--- a/spree/api/app/controllers/spree/api/v3/admin/countries_controller.rb
+++ b/spree/api/app/controllers/spree/api/v3/admin/countries_controller.rb
@@ -25,7 +25,7 @@ module Spree
end
def scope
- Spree::Country.all.order(:name)
+ Spree::Country.all.order(:name).preload_associations_lazily
end
def find_resource