graphqr 0.0.7 → 0.0.8

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
  SHA256:
3
- metadata.gz: 56b827169ae4fc8970f688a1405c1cfce763fdb7619e2b5d64af996ae983de74
4
- data.tar.gz: 5c6b08ea0a203fb0a3e65c7ccef3cdcf511355715fd38315ae50f536d0dcee83
3
+ metadata.gz: 202dc11b523d09002098ed66bcb2bc734a6e4f85fe6ab9a2a7f94cac5b295be8
4
+ data.tar.gz: b824d121adb074e1ffc93d3a42f9f1d976c2a854970c904e49b98644b8282dbb
5
5
  SHA512:
6
- metadata.gz: 6abd868b81b35aaae90b89544e66f0a8a33e75f468ed9004e0a102d331be8e7ebead88092db3dbb6bb17edc1d1b8e1de282fa64d1e597a96af069e57379a6ffe
7
- data.tar.gz: 5c52447a2c4df95b8a14f3caed8b84170667302381ee0e3b8d071f4aa38b06a3d2dd5446a2c7a3be07ceaeeab04d08a49984033d4dd85e0f6bec04784d5f7029
6
+ metadata.gz: 1ca1c6ff7d958e446daa4c7df652728d86157f502a9681e5a3e90e5fc80c6ae433be93120099cb3e15e0b3f62c2d3c4497a7b187ebe2dce30dd185ce2c26bac1
7
+ data.tar.gz: d89ab5d2beddfa96b0937aa6bd414e8941ceb41b9b1748aba5600b895b1e16f5a06f2dab0748d9c2b256df0b661aaf11c7ffcb5404830cf0ea12d95a4041bd42
@@ -34,8 +34,8 @@ module GraphQR
34
34
 
35
35
  def page_info
36
36
  @pagy.tap do |pagy|
37
- pagy.class_eval { attr_accessor :ordered_record_ids }
38
- pagy.ordered_record_ids = @records&.all? { |r| r&.respond_to?(:id) } ? @records.map(&:id) : []
37
+ pagy.class_eval { attr_accessor :ordered_record_ids_proc }
38
+ pagy.ordered_record_ids_proc = -> { @records&.all? { |r| r&.respond_to?(:id) } ? @records.map(&:id) : [] }
39
39
  end
40
40
  end
41
41
  end
@@ -15,7 +15,7 @@ module GraphQR
15
15
 
16
16
  def resolve(record_id:)
17
17
  per_page = object.vars[:items]
18
- records_ids = object.ordered_record_ids
18
+ records_ids = object.ordered_record_ids_proc.call
19
19
  record_index = records_ids.find_index(record_id.to_i)
20
20
 
21
21
  return if per_page.zero? || records_ids.blank? || record_index.blank?
@@ -26,4 +26,4 @@ module GraphQR
26
26
  end
27
27
  end
28
28
  end
29
- end
29
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphQR
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphqr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Puyol
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-02-04 00:00:00.000000000 Z
13
+ date: 2020-05-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: graphql
@@ -52,14 +52,14 @@ dependencies:
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '10.0'
55
+ version: '13.0'
56
56
  type: :development
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '10.0'
62
+ version: '13.0'
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: rdoc
65
65
  requirement: !ruby/object:Gem::Requirement
@@ -187,5 +187,5 @@ signing_key:
187
187
  specification_version: 4
188
188
  summary: Extensions and helpers for graphql-ruby
189
189
  test_files:
190
- - spec/spec_helper.rb
191
190
  - spec/graphqr_spec.rb
191
+ - spec/spec_helper.rb