Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

Bump pagy with breaking changes fix (#1016)

Tony Vincente7dc6b88ea07
diff --git a/Gemfile.lock b/Gemfile.lock
index fcbcc8cc..789a521c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -287,7 +287,7 @@ GEM
octokit (9.1.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
- pagy (8.6.3)
+ pagy (9.0.2)
parallel (1.24.0)
parser (3.3.1.0)
ast (~> 2.4.1)
diff --git a/app/controllers/transactions_controller.rb b/app/controllers/transactions_controller.rb
index 5ad98082..482ed9db 100644
--- a/app/controllers/transactions_controller.rb
+++ b/app/controllers/transactions_controller.rb
@@ -4,7 +4,7 @@ class TransactionsController < ApplicationController
def index
@q = search_params
result = Current.family.entries.account_transactions.search(@q).reverse_chronological
- @pagy, @transaction_entries = pagy(result, items: params[:per_page] || "50")
+ @pagy, @transaction_entries = pagy(result, limit: params[:per_page] || "50")
@totals = {
count: result.select { |t| t.currency == Current.family.currency }.count,
diff --git a/app/views/transactions/_pagination.html.erb b/app/views/transactions/_pagination.html.erb
index dcc8ec0f..eb938008 100644
--- a/app/views/transactions/_pagination.html.erb
+++ b/app/views/transactions/_pagination.html.erb
@@ -46,7 +46,7 @@
data: { controller: "auto-submit-form" } do |f| %>
<%= f.label :per_page, t(".rows_per_page"), class: "text-sm text-gray-500" %>
<%= f.select :per_page,
- options_for_select(["10", "20", "30", "50"], pagy.items),
+ options_for_select(["10", "20", "30", "50"], pagy.limit),
{},
class: "py-1.5 pr-8 text-sm text-gray-900 font-medium border border-gray-200 rounded-lg focus:border-gray-900 focus:ring-gray-900 focus-visible:ring-gray-900",
data: { "auto-submit-form-target": "auto" } %>