dynamoid 3.7.0 → 3.7.1

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: 2146a1a188ecf2b8dd2f280172119879d6612d9eadda6cbcbf6defb3319f7022
4
- data.tar.gz: df59300783324be7952fd25f8d49880707938762d3960ce1d422c18b49e26ac6
3
+ metadata.gz: bc5c35cc32f9e77598030b980baff43156095b9480be6984d67e2cb5116fae47
4
+ data.tar.gz: 7b8ff766d64bf83096bf641f7ca641ab15974f451481a215cf63b69597cf4126
5
5
  SHA512:
6
- metadata.gz: d2ebd06729d024b98338e5c11953976935f5252ad76f6dec9265929fd447ed488295d9f06c8ae5440c7c6a494fb1cdb44ffeba002c18ea52bd4ad100df2d4c66
7
- data.tar.gz: eddf03eb98125fbc7fcfa842e8276ba5dcbd558abacc3adeb2d451e3bb71bcb92f69eb84a01231304b4690b087a826ebf7c4ee2426a16d92a7a126ceddf1e132
6
+ metadata.gz: 0f4ac62013723a6880583471808d823cdbd4b84944357249a4dbad7b4087cf32bffc53880ec599c2f5fd61b07136ce7f7be05677fdc0aedf80ae3cf3c2b7b0ee
7
+ data.tar.gz: 3da0f1ffa1225c5233032330d6d1b9c5e2da60979770b42faecbd8141fd8bd5b9520767c2cc01beb5cee8a7979996cdaa53c3a03c49815c3b01dd23c8dabbb37
data/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@
4
4
 
5
5
 
6
6
 
7
+ # 3.7.1 / 2021-06-30
8
+
9
+ ## Fixes
10
+
11
+ * [#484](https://github.com/Dynamoid/dynamoid/pull/484) Fix model deletion - update cached foreign keys in associated models when delete a model
12
+ * [#492](https://github.com/Dynamoid/dynamoid/pull/492) Fix using `:date` field as an index hash/range key (@yoshida-eth0)
13
+ * [#503](https://github.com/Dynamoid/dynamoid/pull/503) Fix explicit forcing index with `#with_index` method when perform Scan operation (@bmalinconico)
14
+ * [#511](https://github.com/Dynamoid/dynamoid/pull/511) Fix `BatchGetItem` operation when partial result returned (so there are unprocessed keys) and table has a range key. The fix affects `.find_all` method only (@Bajena)
15
+
16
+
17
+
7
18
  # 3.7.0 / 2021-02-02
8
19
 
9
20
 
@@ -86,7 +86,16 @@ module Dynamoid
86
86
  def unprocessed_ids(table)
87
87
  # unprocessed_keys Hash contains as values instances of
88
88
  # Aws::DynamoDB::Types::KeysAndAttributes
89
- @api_response.unprocessed_keys[table.name].keys.map { |h| h[table.hash_key.to_s] }
89
+ @api_response.unprocessed_keys[table.name].keys.map do |h|
90
+ # If a table has a composite key then we need to return an array
91
+ # of [hash_key, composite_key]. Otherwise just return hash key's
92
+ # value.
93
+ if table.range_key.nil?
94
+ h[table.hash_key.to_s]
95
+ else
96
+ [h[table.hash_key.to_s], h[table.range_key.to_s]]
97
+ end
98
+ end
90
99
  end
91
100
 
92
101
  def items_grouped_by_table
@@ -48,7 +48,8 @@ module Dynamoid
48
48
  request = options.slice(
49
49
  :consistent_read,
50
50
  :exclusive_start_key,
51
- :select
51
+ :select,
52
+ :index_name
52
53
  ).compact
53
54
 
54
55
  # Deal with various limits and batching
@@ -770,6 +770,7 @@ module Dynamoid
770
770
 
771
771
  def scan_opts
772
772
  opts = {}
773
+ opts[:index_name] = @key_fields_detector.index_name if @key_fields_detector.index_name
773
774
  opts[:record_limit] = @record_limit if @record_limit
774
775
  opts[:scan_limit] = @scan_limit if @scan_limit
775
776
  opts[:batch_size] = @batch_size if @batch_size
@@ -37,7 +37,7 @@ module Dynamoid
37
37
  end
38
38
 
39
39
  def key_present?
40
- @result.present?
40
+ @result.present? && @query.contain_with_eq_operator?(hash_key)
41
41
  end
42
42
 
43
43
  def hash_key
@@ -14,6 +14,7 @@ module Dynamoid
14
14
  number
15
15
  integer
16
16
  string
17
+ date
17
18
  datetime
18
19
  serialized
19
20
  ].freeze
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dynamoid
4
- VERSION = '3.7.0'
4
+ VERSION = '3.7.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 3.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Symonds
@@ -21,7 +21,7 @@ authors:
21
21
  autorequire:
22
22
  bindir: bin
23
23
  cert_chain: []
24
- date: 2021-02-02 00:00:00.000000000 Z
24
+ date: 2021-06-30 00:00:00.000000000 Z
25
25
  dependencies:
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activemodel
@@ -271,9 +271,9 @@ licenses:
271
271
  - MIT
272
272
  metadata:
273
273
  bug_tracker_uri: https://github.com/Dynamoid/dynamoid/issues
274
- changelog_uri: https://github.com/Dynamoid/dynamoid/tree/v3.7.0/CHANGELOG.md
275
- source_code_uri: https://github.com/Dynamoid/dynamoid/tree/v3.7.0
276
- documentation_uri: https://rubydoc.info/gems/dynamoid/3.7.0
274
+ changelog_uri: https://github.com/Dynamoid/dynamoid/tree/v3.7.1/CHANGELOG.md
275
+ source_code_uri: https://github.com/Dynamoid/dynamoid/tree/v3.7.1
276
+ documentation_uri: https://rubydoc.info/gems/dynamoid/3.7.1
277
277
  post_install_message:
278
278
  rdoc_options: []
279
279
  require_paths:
@@ -289,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
289
289
  - !ruby/object:Gem::Version
290
290
  version: '0'
291
291
  requirements: []
292
- rubygems_version: 3.2.0
292
+ rubygems_version: 3.2.3
293
293
  signing_key:
294
294
  specification_version: 4
295
295
  summary: Dynamoid is an ORM for Amazon's DynamoDB