cursor_pager 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a61d376be58b8a79f723f16b7a95af05e2204bb3086465518fc0bd33bc118f3
4
- data.tar.gz: ee0de4fa845db9c541453d6a269c1890f4b1dad8713857015ce5aa75d30b5a15
3
+ metadata.gz: 0f09f4f6c7c439bf8dc8d20ca19bce69cd7b67d0f6ffe9f8c91be7f3a673ccd6
4
+ data.tar.gz: c79f9159200f3013be13892fd72b51f4ccba8c5111bd17411bde6db2deb9ea8b
5
5
  SHA512:
6
- metadata.gz: 25b37f735e9a74ec8ac7b2ba6bbc25620bf10a35ecfc67bb12df46fca01fc39708dbd6455eccf06de0097b5da981a15f8c26dac7018f4bdd1b7d35e264edd23a
7
- data.tar.gz: 5bccd36ef0e162445bf633acc7f046ecd423a7e310e02f20362e30d86934054a107506957f4d09d9f07a65e63780ea33fa3a2652879c9cbfbd5acde9fbe14717
6
+ metadata.gz: 469e8c30a4974b1f7be434169c46b82518de4c2f034f4c36ba01abf09b23855dd87b1d3689ef426b27b119283db25c4ba878462304c143084205e196571a7acd
7
+ data.tar.gz: b16fd57909391d6d442291baef95adb33ec39181db7a4a1063cbb993ed0cea678fcf9e2ba502992bd91991e18d9246c564b47f1ca83e912c46da2a85bdc0b427
@@ -2,17 +2,23 @@ name: CI
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [master]
5
+ branches: [main]
6
6
  pull_request:
7
- branches: [master]
7
+ branches: [main]
8
8
 
9
9
  jobs:
10
10
  test:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
+ fail-fast: false
13
14
  matrix:
14
- ruby-version: ["2.6", "2.7"]
15
- activerecord-version: ["5.2", "6.0"]
15
+ include:
16
+ - ruby-version: "2.6"
17
+ activerecord-version: "5.2"
18
+ - ruby-version: "2.7"
19
+ activerecord-version: "6.0"
20
+ - ruby-version: "3.0"
21
+ activerecord-version: "6.1"
16
22
 
17
23
  services:
18
24
  db:
data/Appraisals CHANGED
@@ -7,3 +7,7 @@ end
7
7
  appraise "activerecord-6.0" do
8
8
  gem "activerecord", "~> 6.0.0"
9
9
  end
10
+
11
+ appraise "activerecord-6.1" do
12
+ gem "activerecord", "~> 6.1.0"
13
+ end
data/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.4] - 2021-04-01
11
+
12
+ ### Fixed
13
+
14
+ * Fix `Page#next_page?` when given a grouped relation #15
15
+
10
16
  ## [0.2.3] - 2020-11-23
11
17
 
12
18
  ### Fixed
@@ -39,7 +45,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
39
45
  * First implementation of cursor-pased pagination #2
40
46
  * Configurable cursor encoder #3
41
47
 
42
- [Unreleased]: https://github.com/check24-profis/shared-cursor-pager/compare/v0.2.3...HEAD
48
+ [Unreleased]: https://github.com/check24-profis/shared-cursor-pager/compare/v0.2.4...HEAD
49
+ [0.2.4]: https://github.com/check24-profis/shared-cursor-pager/compare/v0.2.3...v0.2.4
43
50
  [0.2.3]: https://github.com/check24-profis/shared-cursor-pager/compare/v0.2.2...v0.2.3
44
51
  [0.2.2]: https://github.com/check24-profis/shared-cursor-pager/compare/v0.2.1...v0.2.2
45
52
  [0.2.1]: https://github.com/check24-profis/shared-cursor-pager/compare/v0.2.0...v0.2.1
data/Gemfile.lock CHANGED
@@ -1,73 +1,75 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cursor_pager (0.2.3)
4
+ cursor_pager (0.2.4)
5
5
  activerecord (>= 5.2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activemodel (6.0.3.1)
11
- activesupport (= 6.0.3.1)
12
- activerecord (6.0.3.1)
13
- activemodel (= 6.0.3.1)
14
- activesupport (= 6.0.3.1)
15
- activesupport (6.0.3.1)
10
+ activemodel (6.1.3.1)
11
+ activesupport (= 6.1.3.1)
12
+ activerecord (6.1.3.1)
13
+ activemodel (= 6.1.3.1)
14
+ activesupport (= 6.1.3.1)
15
+ activesupport (6.1.3.1)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
- i18n (>= 0.7, < 2)
18
- minitest (~> 5.1)
19
- tzinfo (~> 1.1)
20
- zeitwerk (~> 2.2, >= 2.2.2)
21
- appraisal (2.2.0)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ zeitwerk (~> 2.3)
21
+ appraisal (2.4.0)
22
22
  bundler
23
23
  rake
24
24
  thor (>= 0.14.0)
25
- ast (2.4.0)
26
- concurrent-ruby (1.1.6)
27
- database_cleaner (1.8.4)
28
- database_cleaner-active_record (1.8.0)
29
- activerecord
30
- database_cleaner (~> 1.8.0)
31
- diff-lcs (1.3)
32
- i18n (1.8.2)
25
+ ast (2.4.2)
26
+ concurrent-ruby (1.1.8)
27
+ database_cleaner-active_record (2.0.0)
28
+ activerecord (>= 5.a)
29
+ database_cleaner-core (~> 2.0.0)
30
+ database_cleaner-core (2.0.1)
31
+ diff-lcs (1.4.4)
32
+ i18n (1.8.10)
33
33
  concurrent-ruby (~> 1.0)
34
- jaro_winkler (1.5.4)
35
- minitest (5.14.1)
36
- parallel (1.19.1)
37
- parser (2.7.1.1)
38
- ast (~> 2.4.0)
34
+ minitest (5.14.4)
35
+ parallel (1.20.1)
36
+ parser (3.0.0.0)
37
+ ast (~> 2.4.1)
39
38
  pg (1.2.3)
40
39
  rainbow (3.0.0)
41
40
  rake (12.3.3)
41
+ regexp_parser (2.1.1)
42
42
  rexml (3.2.4)
43
- rspec (3.9.0)
44
- rspec-core (~> 3.9.0)
45
- rspec-expectations (~> 3.9.0)
46
- rspec-mocks (~> 3.9.0)
47
- rspec-core (3.9.1)
48
- rspec-support (~> 3.9.1)
49
- rspec-expectations (3.9.1)
43
+ rspec (3.10.0)
44
+ rspec-core (~> 3.10.0)
45
+ rspec-expectations (~> 3.10.0)
46
+ rspec-mocks (~> 3.10.0)
47
+ rspec-core (3.10.1)
48
+ rspec-support (~> 3.10.0)
49
+ rspec-expectations (3.10.1)
50
50
  diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.9.0)
52
- rspec-mocks (3.9.1)
51
+ rspec-support (~> 3.10.0)
52
+ rspec-mocks (3.10.2)
53
53
  diff-lcs (>= 1.2.0, < 2.0)
54
- rspec-support (~> 3.9.0)
55
- rspec-support (3.9.2)
56
- rubocop (0.82.0)
57
- jaro_winkler (~> 1.5.1)
54
+ rspec-support (~> 3.10.0)
55
+ rspec-support (3.10.2)
56
+ rubocop (1.12.0)
58
57
  parallel (~> 1.10)
59
- parser (>= 2.7.0.1)
58
+ parser (>= 3.0.0.0)
60
59
  rainbow (>= 2.2.2, < 4.0)
60
+ regexp_parser (>= 1.8, < 3.0)
61
61
  rexml
62
+ rubocop-ast (>= 1.2.0, < 2.0)
62
63
  ruby-progressbar (~> 1.7)
63
- unicode-display_width (>= 1.4.0, < 2.0)
64
- ruby-progressbar (1.10.1)
65
- thor (1.0.1)
66
- thread_safe (0.3.6)
67
- tzinfo (1.2.7)
68
- thread_safe (~> 0.1)
69
- unicode-display_width (1.7.0)
70
- zeitwerk (2.3.0)
64
+ unicode-display_width (>= 1.4.0, < 3.0)
65
+ rubocop-ast (1.4.1)
66
+ parser (>= 2.7.1.5)
67
+ ruby-progressbar (1.11.0)
68
+ thor (1.1.0)
69
+ tzinfo (2.0.4)
70
+ concurrent-ruby (~> 1.0)
71
+ unicode-display_width (2.0.0)
72
+ zeitwerk (2.4.2)
71
73
 
72
74
  PLATFORMS
73
75
  ruby
@@ -82,4 +84,4 @@ DEPENDENCIES
82
84
  rubocop
83
85
 
84
86
  BUNDLED WITH
85
- 2.1.4
87
+ 2.2.15
data/README.md CHANGED
@@ -119,5 +119,5 @@ The gem is available as open source under the terms of the [MIT License].
119
119
 
120
120
  [JSON API Cursor Pagination]: https://jsonapi.org/profiles/ethanresnick/cursor-pagination/
121
121
  [Relay's GraphQL Cursor Connection]: https://relay.dev/graphql/connections.htm
122
- [code of conduct]: https://github.com/check24-profis/shared-cursor-pager/blob/master/CODE_OF_CONDUCT.md
122
+ [code of conduct]: https://github.com/check24-profis/shared-cursor-pager/blob/main/CODE_OF_CONDUCT.md
123
123
  [MIT License]: https://opensource.org/licenses/MIT
data/cursor_pager.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
17
  spec.metadata["source_code_uri"] = spec.homepage
18
18
  spec.metadata["changelog_uri"] =
19
- "https://github.com/check24-profis/shared-cursor-pager/blob/master/CHANGELOG.md"
19
+ "https://github.com/check24-profis/shared-cursor-pager/blob/main/CHANGELOG.md"
20
20
 
21
21
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
22
22
  `git ls-files -z`
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- cursor_pager (0.2.3)
4
+ cursor_pager (0.2.4)
5
5
  activerecord (>= 5.2.0)
6
6
 
7
7
  GEM
@@ -86,4 +86,4 @@ DEPENDENCIES
86
86
  rubocop
87
87
 
88
88
  BUNDLED WITH
89
- 2.1.4
89
+ 2.2.15
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- cursor_pager (0.2.3)
4
+ cursor_pager (0.2.4)
5
5
  activerecord (>= 5.2.0)
6
6
 
7
7
  GEM
@@ -86,4 +86,4 @@ DEPENDENCIES
86
86
  rubocop
87
87
 
88
88
  BUNDLED WITH
89
- 2.1.4
89
+ 2.2.15
@@ -0,0 +1,13 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "database_cleaner-active_record"
7
+ gem "pg"
8
+ gem "rake", "~> 12.0"
9
+ gem "rspec", "~> 3.0"
10
+ gem "rubocop"
11
+ gem "activerecord", "~> 6.1.0"
12
+
13
+ gemspec path: "../"
@@ -0,0 +1,88 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ cursor_pager (0.2.4)
5
+ activerecord (>= 5.2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (6.1.3.1)
11
+ activesupport (= 6.1.3.1)
12
+ activerecord (6.1.3.1)
13
+ activemodel (= 6.1.3.1)
14
+ activesupport (= 6.1.3.1)
15
+ activesupport (6.1.3.1)
16
+ concurrent-ruby (~> 1.0, >= 1.0.2)
17
+ i18n (>= 1.6, < 2)
18
+ minitest (>= 5.1)
19
+ tzinfo (~> 2.0)
20
+ zeitwerk (~> 2.3)
21
+ appraisal (2.4.0)
22
+ bundler
23
+ rake
24
+ thor (>= 0.14.0)
25
+ ast (2.4.2)
26
+ concurrent-ruby (1.1.8)
27
+ database_cleaner-active_record (2.0.0)
28
+ activerecord (>= 5.a)
29
+ database_cleaner-core (~> 2.0.0)
30
+ database_cleaner-core (2.0.1)
31
+ diff-lcs (1.4.4)
32
+ i18n (1.8.10)
33
+ concurrent-ruby (~> 1.0)
34
+ minitest (5.14.4)
35
+ parallel (1.20.1)
36
+ parser (3.0.0.0)
37
+ ast (~> 2.4.1)
38
+ pg (1.2.3)
39
+ rainbow (3.0.0)
40
+ rake (12.3.3)
41
+ regexp_parser (2.1.1)
42
+ rexml (3.2.4)
43
+ rspec (3.10.0)
44
+ rspec-core (~> 3.10.0)
45
+ rspec-expectations (~> 3.10.0)
46
+ rspec-mocks (~> 3.10.0)
47
+ rspec-core (3.10.1)
48
+ rspec-support (~> 3.10.0)
49
+ rspec-expectations (3.10.1)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.10.0)
52
+ rspec-mocks (3.10.2)
53
+ diff-lcs (>= 1.2.0, < 2.0)
54
+ rspec-support (~> 3.10.0)
55
+ rspec-support (3.10.2)
56
+ rubocop (1.12.0)
57
+ parallel (~> 1.10)
58
+ parser (>= 3.0.0.0)
59
+ rainbow (>= 2.2.2, < 4.0)
60
+ regexp_parser (>= 1.8, < 3.0)
61
+ rexml
62
+ rubocop-ast (>= 1.2.0, < 2.0)
63
+ ruby-progressbar (~> 1.7)
64
+ unicode-display_width (>= 1.4.0, < 3.0)
65
+ rubocop-ast (1.4.1)
66
+ parser (>= 2.7.1.5)
67
+ ruby-progressbar (1.11.0)
68
+ thor (1.1.0)
69
+ tzinfo (2.0.4)
70
+ concurrent-ruby (~> 1.0)
71
+ unicode-display_width (2.0.0)
72
+ zeitwerk (2.4.2)
73
+
74
+ PLATFORMS
75
+ x86_64-darwin-19
76
+
77
+ DEPENDENCIES
78
+ activerecord (~> 6.1.0)
79
+ appraisal
80
+ cursor_pager!
81
+ database_cleaner-active_record
82
+ pg
83
+ rake (~> 12.0)
84
+ rspec (~> 3.0)
85
+ rubocop
86
+
87
+ BUNDLED WITH
88
+ 2.2.15
@@ -60,8 +60,7 @@ module CursorPager
60
60
  @next_page ||= if before_limit_value.present?
61
61
  true
62
62
  elsif first
63
- sliced_relation.unscope(:select).select(1)
64
- .limit(first + 1).count == first + 1
63
+ sliced_relation.offset(first).exists?
65
64
  else
66
65
  false
67
66
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CursorPager
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cursor_pager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bastian Bartmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-23 00:00:00.000000000 Z
11
+ date: 2021-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -53,6 +53,8 @@ files:
53
53
  - gemfiles/activerecord_5.2.gemfile.lock
54
54
  - gemfiles/activerecord_6.0.gemfile
55
55
  - gemfiles/activerecord_6.0.gemfile.lock
56
+ - gemfiles/activerecord_6.1.gemfile
57
+ - gemfiles/activerecord_6.1.gemfile.lock
56
58
  - lib/cursor_pager.rb
57
59
  - lib/cursor_pager/base64_encoder.rb
58
60
  - lib/cursor_pager/configuration.rb
@@ -72,7 +74,7 @@ licenses:
72
74
  metadata:
73
75
  homepage_uri: https://github.com/check24-profis/shared-cursor-pager
74
76
  source_code_uri: https://github.com/check24-profis/shared-cursor-pager
75
- changelog_uri: https://github.com/check24-profis/shared-cursor-pager/blob/master/CHANGELOG.md
77
+ changelog_uri: https://github.com/check24-profis/shared-cursor-pager/blob/main/CHANGELOG.md
76
78
  post_install_message:
77
79
  rdoc_options: []
78
80
  require_paths: