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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef072fcfdb860880f1bc64576edc8d19660b0f4a
4
- data.tar.gz: 733fa952412342474a7055a5bfc1bf9eb25658c6
3
+ metadata.gz: 24794d49a1531ed3ab3a00c71c6b9a963e42bb46
4
+ data.tar.gz: 23cc7603801d8948df99667797b60949a8d601da
5
5
  SHA512:
6
- metadata.gz: 62ae914ea2acd998b3997da0601582cc148d43f97aae635ac7231f7e6efca0014698a11b5407dbc92bc8a948b0c2bf2370aa8769997ef5c77268252bb5685bcf
7
- data.tar.gz: 453d69ab87fc3166623a16608da51c44c774343eea3af15452a82fd5c04b39e84b451d4a0a9065f41e5f98afa33f1b5f05aa5042b0695a56bd17769ce228c772
6
+ metadata.gz: 64f858bce99a796dc7ab0885b12c0027542bed4dff38120d41c244c98143931869605683c41d72cab9b504a4e53a2c46229678951913ef989216c5877aa6bf3a
7
+ data.tar.gz: e9b2883c66a01680d3d6432ba4edd64ceb64c9e64ecc9031ade63ba79ed29150e0391f23588eb0c4febaebe1eb20b2fe69a50ab041f669ed9c19d8a33d63fb59
@@ -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 ultimetaly 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.
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`
@@ -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
- sort_direction: @sort_direction,
57
- anchor_id: self.resources.last&.id
57
+ page_size: @page_size,
58
+ sort_direction: @sort_direction
58
59
  }
59
60
  end
60
61
 
@@ -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.0.0"
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", "<= 5.1"]
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.0.0
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: '5.1'
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: '5.1'
32
+ version: '6.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement