Skip to content

Commit e204007

Browse files
committed
New Pagy
1 parent 926bfe9 commit e204007

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

Gemfile.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ GEM
147147
faraday-httpclient (1.0.1)
148148
faraday-multipart (1.0.4)
149149
multipart-post (~> 2)
150-
faraday-net_http (1.0.1)
150+
faraday-net_http (1.0.2)
151151
faraday-net_http_persistent (1.2.0)
152152
faraday-patron (1.0.0)
153153
faraday-rack (1.0.0)
@@ -286,7 +286,7 @@ GEM
286286
omniauth (~> 2.0)
287287
openssl (3.2.0)
288288
os (1.1.4)
289-
pagy (8.6.3)
289+
pagy (9.0.2)
290290
pdf-reader (2.11.0)
291291
Ascii85 (~> 1.0)
292292
afm (~> 0.2.1)
@@ -302,7 +302,7 @@ GEM
302302
pry (>= 0.13, < 0.15)
303303
psych (5.1.2)
304304
stringio
305-
public_suffix (6.0.0)
305+
public_suffix (6.0.1)
306306
puma (6.4.2)
307307
nio4r (~> 2.0)
308308
racc (1.8.0)
@@ -404,7 +404,7 @@ GEM
404404
searchkick (5.3.1)
405405
activemodel (>= 6.1)
406406
hashie
407-
selenium-webdriver (4.22.0)
407+
selenium-webdriver (4.23.0)
408408
base64 (~> 0.2)
409409
logger (~> 1.4)
410410
rexml (~> 3.2, >= 3.2.5)
@@ -438,7 +438,7 @@ GEM
438438
trailblazer-option (0.1.2)
439439
ttfunk (1.8.0)
440440
bigdecimal (~> 3.1)
441-
turbo-rails (2.0.5)
441+
turbo-rails (2.0.6)
442442
actionpack (>= 6.0.0)
443443
activejob (>= 6.0.0)
444444
railties (>= 6.0.0)

app/controllers/invitations_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class InvitationsController < ApplicationController
55
def index
66
invitations_scope = @track.present? ? Invitation.by_track(@track.id) : Invitation
77

8-
@pagy, @invitations = pagy(invitations_scope.includes(:editor, :paper).order(created_at: :desc), items: 25)
8+
@pagy, @invitations = pagy(invitations_scope.includes(:editor, :paper).order(created_at: :desc), limit: 25)
99
end
1010

1111
def expire

config/initializers/pagy.rb

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# frozen_string_literal: true
22

33
# Default page size
4-
Pagy::DEFAULT[:items] = 20
5-
6-
# No page links
7-
Pagy::DEFAULT[:size] = []
4+
Pagy::DEFAULT[:limit] = 20
85

96
require 'pagy/extras/overflow'
107
Pagy::DEFAULT[:overflow] = :empty_page

spec/views/papers/recent.html.erb_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
create(:accepted_paper, submitting_author: user)
1111
end
1212

13-
assign(:pagy, Pagy.new({count: Paper.all.count, page: 1}))
13+
assign(:pagy, Pagy.new(count: Paper.all.count, page: 1))
1414
assign(:papers, Paper.all)
1515

1616
render template: "papers/index", formats: :html

spec/views/papers/submitted.html.erb_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
create(:paper, state: "submitted", submitting_author: user)
1616

17-
assign(:pagy, Pagy.new({count: Paper.submitted.count, page: 1}))
17+
assign(:pagy, Pagy.new(count: Paper.submitted.count, page: 1))
1818
assign(:papers, Paper.submitted)
1919

2020
render template: "papers/index", formats: :html

0 commit comments

Comments
 (0)