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.

Changed Pagy max_limit option to client_limit (#14832)

Damian Legawiec60b6ac578737
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 30c8024011..da3b429270 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
@@ -11,7 +11,7 @@ module Spree
# Override base index to skip pagination — there are ~250 countries
# and address-form dropdowns need them all at once. Pagy's global
- # max_limit (100) prevents using the paginated path for this.
+ # client_limit (100) prevents using the paginated path for this.
#
# Countries are reference data rather than records, so this reads
# from the registry and needs no authorization beyond the admin
diff --git a/spree/api/app/controllers/spree/api/v3/seller/countries_controller.rb b/spree/api/app/controllers/spree/api/v3/seller/countries_controller.rb
index ebc5ced65f..4adae7781b 100644
--- a/spree/api/app/controllers/spree/api/v3/seller/countries_controller.rb
+++ b/spree/api/app/controllers/spree/api/v3/seller/countries_controller.rb
@@ -14,7 +14,7 @@ module Spree
# GET /api/v3/seller/countries
#
# Unpaginated: there are ~250 countries and an address dropdown needs
- # them all at once, which Pagy's global max_limit would prevent.
+ # them all at once, which Pagy's global client_limit would prevent.
def index
countries = Spree::Country.all.sort_by(&:name)
diff --git a/spree/api/config/initializers/pagy.rb b/spree/api/config/initializers/pagy.rb
index 06e0ea91e4..17f9778ba2 100644
--- a/spree/api/config/initializers/pagy.rb
+++ b/spree/api/config/initializers/pagy.rb
@@ -5,4 +5,4 @@
Pagy::OPTIONS[:limit] = 25
# Maximum number of items per page
-Pagy::OPTIONS[:max_limit] = 100
+Pagy::OPTIONS[:client_limit] = 100
diff --git a/spree/core/spree_core.gemspec b/spree/core/spree_core.gemspec
index 29a92986b4..9c9a96d1de 100644
--- a/spree/core/spree_core.gemspec
+++ b/spree/core/spree_core.gemspec
@@ -81,5 +81,5 @@ Gem::Specification.new do |s|
s.add_dependency 'bcrypt', '~> 3.1'
s.add_dependency 'sqids', '~> 0.2'
s.add_dependency 'ssrf_filter', '~> 1.0'
- s.add_dependency 'pagy', '>= 43.3'
+ s.add_dependency 'pagy', '>= 43.6.3'
end