dynamoid_advanced_where 1.7.0 → 1.7.1

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: 239094fa5509e994cefa186a296b6f00bbc7a13913ea67803f82f173e6aea82a
4
- data.tar.gz: cb46ded36d28fc09b54ea3b1598c34e2172232824056c9b6462f846f491e9673
3
+ metadata.gz: 1a85cd45266e1210f64c5d4bd1187416c2643aeb5de64d66c9f9ad9fbd4ba456
4
+ data.tar.gz: ab0281d70cdc10879af23d28e9fefac40679e3c28da55d19244b828718c30d5a
5
5
  SHA512:
6
- metadata.gz: bce42bfde6205d3a63ea557b0624391170f586220247fc3c7ab17a1203eb6876d4356b6758a41df0756ea9de07ee06b29ce84ba4c40b516143a803d2d361a9cc
7
- data.tar.gz: 633267b36adc9112e67aa8c541946d4ce9a56821d68aa339af211c5ffa400c6b6491b188e33f1dcda01ebd4ea32842fffcde432a783687d14080fc589beecb52
6
+ metadata.gz: 42dfd340ba7191b51b172615cfe7cef602906f88b30f5023e519bbea01e12e9ad2af7833607500cb9408a88b0f13144237dea0cbdfe36ed22bb3124f6e00ffe8
7
+ data.tar.gz: a3b3fb6011989832dc5ae91cca827a63e17fb4a920d897a5ab0c8d76bf56d5c1ca822552f112f77fe3c3b7b62db1c183988cbf63ff48a83ea1135fa1c388b497
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dynamoid_advanced_where (1.6.0)
4
+ dynamoid_advanced_where (1.7.1)
5
5
  dynamoid (>= 3.2, < 4)
6
6
 
7
7
  GEM
@@ -54,28 +54,29 @@ module DynamoidAdvancedWhere
54
54
 
55
55
  query[:limit] = query_builder.record_limit if query_builder.record_limit
56
56
 
57
- page_start = start_hash
57
+ query[:exclusive_start_key] = start_hash
58
58
 
59
59
  Enumerator.new do |yielder|
60
60
  loop do
61
- query[:exclusive_start_key] = page_start
62
61
  results = yield(query)
63
62
 
64
- items = (results.items || []).map do |item|
65
- klass.from_database(item.symbolize_keys)
66
- end
67
-
68
- yielder.yield(items, results)
63
+ yielder.yield(construct_items(results.items), results)
69
64
 
70
65
  query[:limit] = query[:limit] - results.items.length if query[:limit]
71
66
 
72
67
  break if results.last_evaluated_key.nil? || query[:limit]&.zero?
73
68
 
74
- (page_start = results.last_evaluated_key)
69
+ query[:exclusive_start_key] = results.last_evaluated_key
75
70
  end
76
71
  end.lazy
77
72
  end
78
73
 
74
+ def construct_items(items)
75
+ (items || []).map do |item|
76
+ klass.from_database(item)
77
+ end
78
+ end
79
+
79
80
  def each_page_via_query
80
81
  query = {
81
82
  table_name: table_name,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynamoidAdvancedWhere
4
- VERSION = '1.7.0'
4
+ VERSION = '1.7.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamoid_advanced_where
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Malinconico
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-19 00:00:00.000000000 Z
11
+ date: 2023-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynamoid