dmp-dynamo_adapter 0.3.2 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dmp/dynamo_adapter.rb +2 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6591d15b252c3b6252d1bae91ea019912b62971f05edab4a7ece2cbd9d4a1b1
4
- data.tar.gz: 8ac48813d44b7afb0d7cf388a707cb6571ec1b57013b829e68d7f3a7d5c6588e
3
+ metadata.gz: e43418981a0779208d1a8a30b20c49bc1b7694170dd750d21f0a55397dd26270
4
+ data.tar.gz: 8a31a47ea2e473a3297050cb3f3f6499ce1f62f220c8b25014f775153b542fbe
5
5
  SHA512:
6
- metadata.gz: 638372a06477483b5860fcfcea5e7a57c8d47042555871a3c65ded656e23b175b0d426f8138abfa7677f1ca8a9df42fe3c8882e45e897f7c58a5c7c88e08d1ba
7
- data.tar.gz: 2283314e1c73399d762f06fc3b1e51aeee7f622e617f85cc45a55c0bfdd2e3225e9471bf308e26ed6a966df5a2e8e2926332fab877d227a6df746cea68090f97
6
+ metadata.gz: a4165f8e97a095e1390a7e8338a5b8fbfb56e40735a43432a1ace264d7ae2f6e9d093d7ab02efec61ef7f30a7858178ca3eb956d7e727a58a847d7566bc45580
7
+ data.tar.gz: 18d6c30540bef144f768034c3c35e05f43d2a892f49bd0b1eafc6bcdc3b332efc6e3fcaa903d145197c6528009ca93deff9c2daab016ba920de8baed8d7d051d
@@ -89,7 +89,7 @@ p "FINDING BY PK: PK - #{p_key.inspect} / SK - #{s_key.inspect}"
89
89
 
90
90
  # find_by_PK
91
91
  response = find_by_pk(p_key: pk, s_key: json['SK']) unless pk.nil?
92
- return response unless response[:status] != 404
92
+ return response unless response[:status] == 404
93
93
 
94
94
  # find_by_dmphub_provenance_id -> if no PK and no dmp_id result
95
95
  find_by_dmphub_provenance_identifier(json: json)
@@ -285,8 +285,7 @@ pp response.data
285
285
  return { status: 404, error: MSG_NOT_FOUND } if response.nil? || response[:count] <= 0
286
286
 
287
287
  # If we got a hit, fetch the DMP and return it.
288
- find_by_pk(p_key: response.fetch(:last_evaluated_key, {})[:hash_key_element],
289
- s_key: response.fetch(:last_evaluated_key, {})[:range_key_element])
288
+ find_by_pk(p_key: response[:items].first['PK'], s_key: response[:items].first['SK'])
290
289
  rescue Aws::Errors::ServiceError => e
291
290
  { status: 500, error: "#{MSG_DEFAULT} - #{e.message}" }
292
291
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dmp-dynamo_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - briri