geared_pagination 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +1 -1
- data/geared_pagination.gemspec +1 -1
- data/lib/geared_pagination/page.rb +1 -1
- data/test/page_test.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3e2956267a150a716db8afc9a1e0a9b03ac14906162faa283d5de88624b2f21
|
4
|
+
data.tar.gz: 85222f625262561aafae1025403375f21adc4fb3b78d750d68929183dcd2269b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebaba73472a04348a60e2e73b679dc4040f39e9b2193816bdda3c111c3a6dc9d16bcf944d4a4adf3c41b9636f6f4d194d21137dcf652f727e3223ae0576b21b1
|
7
|
+
data.tar.gz: 657c6f6d8d0ee877910fb0f394e5229928325af59c471aa48c8bcddb34c75a824a5c92a128bb60757d2178205c914e3aaf3c2c96adcff036fba0098a30c7e3fe
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
geared_pagination (0.
|
4
|
+
geared_pagination (1.0.1)
|
5
5
|
activesupport (>= 5.0)
|
6
6
|
addressable (>= 2.5.0)
|
7
7
|
|
@@ -63,8 +63,8 @@ GEM
|
|
63
63
|
minitest (~> 5.1)
|
64
64
|
tzinfo (~> 1.1)
|
65
65
|
zeitwerk (~> 2.2, >= 2.2.2)
|
66
|
-
addressable (2.
|
67
|
-
public_suffix (>= 2.0.2, <
|
66
|
+
addressable (2.7.0)
|
67
|
+
public_suffix (>= 2.0.2, < 5.0)
|
68
68
|
builder (3.2.4)
|
69
69
|
byebug (10.0.2)
|
70
70
|
concurrent-ruby (1.1.6)
|
@@ -89,7 +89,7 @@ GEM
|
|
89
89
|
nio4r (2.5.2)
|
90
90
|
nokogiri (1.10.9)
|
91
91
|
mini_portile2 (~> 2.4.0)
|
92
|
-
public_suffix (
|
92
|
+
public_suffix (4.0.5)
|
93
93
|
rack (2.2.2)
|
94
94
|
rack-test (1.1.0)
|
95
95
|
rack (>= 1.0, < 3)
|
data/README.md
CHANGED
@@ -59,7 +59,7 @@ ORDER BY created_at DESC, id DESC
|
|
59
59
|
LIMIT 30
|
60
60
|
```
|
61
61
|
|
62
|
-
Geared Pagination supports cursor-based pagination. To use it, pass the `:
|
62
|
+
Geared Pagination supports cursor-based pagination. To use it, pass the `:ordered_by` option to `set_page_and_extract_portion_from` in your controllers. Provide the orders to apply to the paginated relation:
|
63
63
|
|
64
64
|
```ruby
|
65
65
|
set_page_and_extract_portion_from Message.all, ordered_by: { created_at: :desc, id: :desc }
|
data/geared_pagination.gemspec
CHANGED
data/test/page_test.rb
CHANGED
@@ -19,6 +19,11 @@ class GearedPagination::PageTest < ActiveSupport::TestCase
|
|
19
19
|
assert_not GearedPagination::Recordset.new(Recording.all, per_page: 1).page(1).last?
|
20
20
|
end
|
21
21
|
|
22
|
+
test "last with page number greater than page count" do
|
23
|
+
page_for_empty_set = GearedPagination::Recordset.new(Recording.none, per_page: 1000).page(2)
|
24
|
+
assert page_for_empty_set.last?
|
25
|
+
end
|
26
|
+
|
22
27
|
test "next offset param" do
|
23
28
|
assert_equal 2, GearedPagination::Recordset.new(Recording.all, per_page: 1000).page(1).next_param
|
24
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geared_pagination
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|