pageturner 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/README.md +2 -1
- data/lib/pageturner.rb +3 -2
- data/pageturner.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24794d49a1531ed3ab3a00c71c6b9a963e42bb46
|
4
|
+
data.tar.gz: 23cc7603801d8948df99667797b60949a8d601da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64f858bce99a796dc7ab0885b12c0027542bed4dff38120d41c244c98143931869605683c41d72cab9b504a4e53a2c46229678951913ef989216c5877aa6bf3a
|
7
|
+
data.tar.gz: e9b2883c66a01680d3d6432ba4edd64ceb64c9e64ecc9031ade63ba79ed29150e0391f23588eb0c4febaebe1eb20b2fe69a50ab041f669ed9c19d8a33d63fb59
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# v3.1.0
|
2
|
+
|
3
|
+
## Changes
|
4
|
+
|
5
|
+
* https://github.com/crzrcn/pageturner/commit/241c80d33e6d4ffd17adad0e804da0ce879d420b - Expose the page size in the next cursor's state.
|
6
|
+
* Relaxed activerecord dependency from `<= 5.1` to `< 6.0`.
|
7
|
+
|
1
8
|
# v3.0.0
|
2
9
|
|
3
10
|
## Backwards Incompatible Changes
|
@@ -9,7 +16,7 @@
|
|
9
16
|
|
10
17
|
## Backwards Incompatible Changes
|
11
18
|
|
12
|
-
* https://github.com/crzrcn/pageturner/pull/6 - Do not make any assumptions over page size. The page size for a collection is
|
19
|
+
* https://github.com/crzrcn/pageturner/pull/6 - Do not make any assumptions over page size. The page size for a collection is ultimately known by the caller, so we accept a `page_size` parameter and use that value for the limit clause we apply on the given ActiveRecord::Relation. Before this change, Pageturner would apply a hardcoded page size that was defined within Pageturner itself. Users will need to modify their programs to pass the page size since Pageturner no longer enforces a page size.
|
13
20
|
|
14
21
|
# v1.0.0
|
15
22
|
|
data/README.md
CHANGED
@@ -22,6 +22,7 @@ query = Model.where(params[:filters])
|
|
22
22
|
anchor_column: @pagination.next_cursor[:anchor_column]
|
23
23
|
anchor_id: @pagination.next_cursor[:anchor_id],
|
24
24
|
anchor_value: @pagination.next_cursor[:anchor_value],
|
25
|
+
page_size: @pagination.next_cursor[:page_size],
|
25
26
|
sort_direction: @pagination.next_cursor[:sort_direction]
|
26
27
|
)
|
27
28
|
```
|
@@ -59,7 +60,7 @@ query = Model.where(params[:filters])
|
|
59
60
|
|
60
61
|
```ruby
|
61
62
|
irb(main):001:0> @pagination.next_cursor
|
62
|
-
=> {:anchor_column=>"name", :anchor_value=>"foo", :sort_direction=>"desc", :anchor_id=>3}
|
63
|
+
=> {:anchor_column=>"name", :anchor_value=>"foo", :sort_direction=>"desc", :anchor_id=>3, :page_size=>25}
|
63
64
|
```
|
64
65
|
|
65
66
|
### `#resources`
|
data/lib/pageturner.rb
CHANGED
@@ -52,9 +52,10 @@ class Pageturner
|
|
52
52
|
|
53
53
|
{
|
54
54
|
anchor_column: @anchor_column,
|
55
|
+
anchor_id: self.resources.last&.id,
|
55
56
|
anchor_value: anchor_value,
|
56
|
-
|
57
|
-
|
57
|
+
page_size: @page_size,
|
58
|
+
sort_direction: @sort_direction
|
58
59
|
}
|
59
60
|
end
|
60
61
|
|
data/pageturner.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "pageturner"
|
7
|
-
spec.version = "3.
|
7
|
+
spec.version = "3.1.0"
|
8
8
|
spec.authors = ["crzrcn"]
|
9
9
|
spec.email = ["fernanlink@gmail.com"]
|
10
10
|
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
spec.license = "MPL-2.0"
|
22
22
|
|
23
|
-
spec.add_dependency "activerecord", [">= 4.2", "
|
23
|
+
spec.add_dependency "activerecord", [">= 4.2", "< 6.0"]
|
24
24
|
|
25
25
|
spec.add_development_dependency "bundler", "~> 1.16"
|
26
26
|
spec.add_development_dependency "rake", "~> 10.5"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pageturner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- crzrcn
|
@@ -17,9 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '4.2'
|
20
|
-
- - "
|
20
|
+
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '6.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +27,9 @@ dependencies:
|
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '4.2'
|
30
|
-
- - "
|
30
|
+
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '6.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|