File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,14 @@ def paginate_with_pagy(collection, options)
50
50
if Pagy ::DEFAULT [ :max_per_page ] && options [ :per_page ] > Pagy ::DEFAULT [ :max_per_page ]
51
51
options [ :per_page ] = Pagy ::DEFAULT [ :max_per_page ]
52
52
elsif options [ :per_page ] <= 0
53
- options [ :per_page ] = Pagy ::DEFAULT [ :items ]
53
+ options [ :per_page ] = Pagy ::DEFAULT [ :limit ]
54
54
end
55
55
56
56
pagy = pagy_from ( collection , options )
57
57
collection = if collection . respond_to? ( :offset ) && collection . respond_to? ( :limit )
58
- collection . offset ( pagy . offset ) . limit ( pagy . items )
58
+ collection . offset ( pagy . offset ) . limit ( pagy . limit )
59
59
else
60
- collection [ pagy . offset , pagy . items ]
60
+ collection [ pagy . offset , pagy . limit ]
61
61
end
62
62
63
63
return [ collection , pagy ]
@@ -70,7 +70,7 @@ def pagy_from(collection, options)
70
70
count = collection . is_a? ( Array ) ? collection . count : collection . count ( :all )
71
71
end
72
72
73
- Pagy . new ( count : count , items : options [ :per_page ] , page : options [ :page ] )
73
+ Pagy . new ( count : count , limit : options [ :per_page ] , page : options [ :page ] )
74
74
end
75
75
76
76
def pagy_pages_from ( pagy )
Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ class Fixnum
286
286
287
287
expect ( response . header [ 'Per-Page' ] ) . to eq (
288
288
case ApiPagination . config . paginator
289
- when :pagy then Pagy ::DEFAULT [ :items ] . to_s
289
+ when :pagy then Pagy ::DEFAULT [ :limit ] . to_s
290
290
when :kaminari then Kaminari . config . default_per_page . to_s
291
291
when :will_paginate then WillPaginate . per_page . to_s
292
292
end
@@ -301,7 +301,7 @@ class Fixnum
301
301
302
302
expect ( response . header [ 'Per-Page' ] ) . to eq (
303
303
case ApiPagination . config . paginator
304
- when :pagy then Pagy ::DEFAULT [ :items ] . to_s
304
+ when :pagy then Pagy ::DEFAULT [ :limit ] . to_s
305
305
when :kaminari then Kaminari . config . default_per_page . to_s
306
306
when :will_paginate then WillPaginate . per_page . to_s
307
307
end
You can’t perform that action at this time.
0 commit comments