From 9f6e5af0011263eda52c7d87c7fb19c11c32fc6f Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Tue, 24 Sep 2024 11:24:49 +0100 Subject: [PATCH] upgrade pagy 8.6.3 => 9.0.9 --- Gemfile.lock | 8 ++++---- config/initializers/pagy.rb | 2 +- spec/features/admin/admin_payroll_runs_spec.rb | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 49c10e36ea..cf1f9d3748 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -214,10 +214,10 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) - govuk-components (5.4.0) + govuk-components (5.6.1) html-attributes-utils (~> 1.0.0, >= 1.0.0) - pagy (>= 6, < 9) - view_component (>= 3.9, < 3.13) + pagy (>= 6, < 10) + view_component (>= 3.9, < 3.15) govuk_design_system_formbuilder (5.4.0) actionview (>= 6.1) activemodel (>= 6.1) @@ -325,7 +325,7 @@ GEM webfinger (~> 1.2) os (1.1.4) ostruct (0.6.0) - pagy (8.6.3) + pagy (9.0.9) parallel (1.25.1) parallel_tests (4.7.1) parallel diff --git a/config/initializers/pagy.rb b/config/initializers/pagy.rb index 4f4cf69e62..3bf7c8e92b 100644 --- a/config/initializers/pagy.rb +++ b/config/initializers/pagy.rb @@ -1,6 +1,6 @@ require "pagy/extras/overflow" require "pagy/extras/pagy" -Pagy::DEFAULT[:items] = 50 +Pagy::DEFAULT[:limit] = 50 Pagy::DEFAULT[:overflow] = :last_page Pagy::DEFAULT[:size] = [1, 1, 1, 1] diff --git a/spec/features/admin/admin_payroll_runs_spec.rb b/spec/features/admin/admin_payroll_runs_spec.rb index a4b7d0c9de..29ba848608 100644 --- a/spec/features/admin/admin_payroll_runs_spec.rb +++ b/spec/features/admin/admin_payroll_runs_spec.rb @@ -252,10 +252,10 @@ scenario "Payments can be browsed using pagination" do payroll_run = create(:payroll_run, claims_counts: {Policies::StudentLoans => 7}) - stub_const("Pagy::DEFAULT", Pagy::DEFAULT.merge(items: 5)) + stub_const("Pagy::DEFAULT", Pagy::DEFAULT.merge(limit: 5)) - first_page_payments = payroll_run.payments.ordered[0..Pagy::DEFAULT[:items] - 1] - second_page_payments = payroll_run.payments.ordered[Pagy::DEFAULT[:items]..] + first_page_payments = payroll_run.payments.ordered[0..Pagy::DEFAULT[:limit] - 1] + second_page_payments = payroll_run.payments.ordered[Pagy::DEFAULT[:limit]..] click_on "Payroll" click_on "View #{I18n.l(payroll_run.created_at.to_date, format: :month_year)} payroll run"