dynamodb_record 0.3.5 → 0.4.0

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: af02c1c5b3c550bf839dd80ffa8fbb6442d1010580c8a04df52e3f16b3a08398
4
- data.tar.gz: f59bfc3d99eae48c7826051a13883474dd2bab6c9166c4e28ea7571bcabd6ac0
3
+ metadata.gz: 6762255063b8f9a30d09588eca5913f5ea24ec6bfce97804b6dd4e394decd78e
4
+ data.tar.gz: 7741cd68eee38e210eb097a1437ff30c937d11bc7242f19ada0309bd2ab1f910
5
5
  SHA512:
6
- metadata.gz: 36c31a10c2844617be33117e8104ea28835f68b5322e16fd2f9d2ed16319337a138222b938f5dbbab1df62ca1d15567fbe494561b46b5adfd710843f507ecc6e
7
- data.tar.gz: a7c502ca5c3d79fef89e15371f5ed62d6462ba3a9c3405e60f7a5abc928d935d9c83e01410ea7f57a359f390c225259a9701aa0c5032dce81b0c7edb7787434c
6
+ metadata.gz: e8a2ee7f44414920aa2271c1c227e6c2b511fdae25567010d60c814a9ab6a06ed745bf04833d4b3fba83bc982d8e57a9c492e1e1bf18be2fe7f770d21828b1ed
7
+ data.tar.gz: 9d5122396ab44ef468f9c9a8e857fd3ecb317cea8bf9ea72f6a7b94f01bdaf62c2329d7354dbec9a576035d3173299cef81cd2619bf5d38ecc61ccd6f1c22625
@@ -77,29 +77,31 @@ module DynamodbRecord
77
77
  sorted_list = list.sort
78
78
 
79
79
  define_method(associations) do
80
- options = {}
81
- pluralize_name = sorted_list.map(&:pluralize).join('-')
82
- table = Config.namespace ? "#{Config.namespace}-#{pluralize_name}" : pluralize_name
83
- options[:table_name] = table
84
- if sorted_list.first == base_model
85
- field = sorted_list.first
80
+ if @collection.nil?
81
+ options = {}
82
+ pluralize_name = sorted_list.map(&:pluralize).join('-')
83
+ table = Config.namespace ? "#{Config.namespace}-#{pluralize_name}" : pluralize_name
84
+ options[:table_name] = table
85
+ if sorted_list.first == base_model
86
+ field = sorted_list.first
87
+ else
88
+ field = sorted_list.last
89
+ options.merge!(index_name: "#{table}-index")
90
+ end
91
+
92
+ options.merge!(key_condition_expression: "##{field}_id = :#{field}_id")
93
+ options.merge!(expression_attribute_names: {"##{field}_id": "#{field}_id"})
94
+
95
+ options.merge!(expression_attribute_values: {":#{field}_id" => id})
96
+
97
+ klass = Object.const_get(relation_model.capitalize)
98
+ # options.merge!(limit: 1)
99
+ # p options
100
+ query = QueryPager.new(options, klass)
101
+ @collection = HasAndBelongsToManyCollection.new(query, self)
86
102
  else
87
- field = sorted_list.last
88
- options.merge!(index_name: "#{table}-index")
103
+ @collection
89
104
  end
90
-
91
- options.merge!(key_condition_expression: "##{field}_id = :#{field}_id")
92
- options.merge!(expression_attribute_names: {"##{field}_id": "#{field}_id"})
93
-
94
- options.merge!(expression_attribute_values: {":#{field}_id" => id})
95
-
96
- klass = Object.const_get(relation_model.capitalize)
97
-
98
- # options.merge!(limit: 1)
99
- # p options
100
-
101
- query = QueryPager.new(options, klass)
102
- HasAndBelongsToManyCollection.new(query, self)
103
105
  end
104
106
  end
105
107
  # rubocop:enable Naming/PredicateName
@@ -45,9 +45,25 @@ module DynamodbRecord
45
45
  table_name = @options[:table_name]
46
46
  item = @options[:expression_attribute_values].transform_keys { |k| k.delete_prefix(':').to_sym }
47
47
  item[:"#{@base_model}_id"] = object.id
48
+ item[:created_at] = DateTime.now.to_s
48
49
  key = {table_name:, item:}
49
- @klass.client.put_item(key)
50
- @items << object
50
+
51
+ res = @items.none? { |data| data.id == object.id }
52
+ if res
53
+ @klass.client.put_item(key)
54
+ @items << object
55
+ end
56
+ @items
57
+ end
58
+
59
+ def destroy(object)
60
+ table_name = @options[:table_name]
61
+ item = @options[:expression_attribute_values].transform_keys { |k| k.delete_prefix(':').to_sym }
62
+ item[:"#{@base_model}_id"] = object.id
63
+ key = {table_name:, key: item}
64
+ @klass.client.delete_item(key)
65
+ @items.delete_if { |data| data.id == object.id }
66
+ object
51
67
  end
52
68
 
53
69
  def create!(params = {})
@@ -59,6 +75,7 @@ module DynamodbRecord
59
75
  item = @options[:expression_attribute_values].transform_keys { |k| k.delete_prefix(':').to_sym }
60
76
 
61
77
  item[:"#{@klass.to_s.downcase}_id"] = object.id
78
+ item[:created_at] = DateTime.now.to_s
62
79
  key = {table_name:, item:}
63
80
  @klass.client.put_item(key)
64
81
  object
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DynamodbRecord
4
- VERSION = '0.3.5'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -15,12 +15,33 @@ RSpec.describe DynamodbRecord::Associations, :vcr do
15
15
  expect(users).to be_an(DynamodbRecord::HasManyThroughCollection)
16
16
  end
17
17
 
18
- it 'has_and_belongs_to_many create' do
19
- car = Car.find!('UVX455')
20
- user = car.users.create!(id: 'hguzman50@gmail.com')
21
- expect(user).to be_an(User)
18
+ describe '#has_and_belongs_to_many' do
19
+ it 'only one record' do
20
+ car = Car.find!('UVX455')
21
+ user = User.find!('hguzman10@gmail.com')
22
+ expect(user.cars.count).to eq(0)
23
+ user.cars << car
24
+ expect(user.cars.count).to eq(1)
25
+ user.cars << car
26
+ expect(user.cars.count).to eq(1)
27
+ end
28
+
29
+ it 'create' do
30
+ car = Car.find!('UVX455')
31
+ user = car.users.create!(id: 'hguzman50@gmail.com')
32
+ expect(user).to be_an(User)
33
+ end
34
+
35
+ it 'destroy' do
36
+ car = Car.find!('UVX455')
37
+ user = User.find('hguzman50@gmail.com')
38
+ car.users.destroy(user)
39
+ expect(car.users.count).to eq(2)
40
+ end
41
+
22
42
  end
23
43
 
44
+
24
45
  describe '#has_many' do
25
46
  it 'get collection' do
26
47
  car = Car.find!('UVX455')
@@ -33,13 +54,6 @@ RSpec.describe DynamodbRecord::Associations, :vcr do
33
54
  insurance = car.insurances.create!(name: 'fasecolda')
34
55
  expect(insurance).to be_an(Insurance)
35
56
  end
36
-
37
- it 'add list' do
38
- user = User.find!('hguzman10@gmail.com')
39
- car = Car.find!('UVX455')
40
- user.cars << car
41
- expect(user.cars.count).to eq(1)
42
- end
43
57
  end
44
58
 
45
59
  describe '#belongs_to' do
@@ -1,7 +1,6 @@
1
1
  require_relative '../spec_helper'
2
2
 
3
3
  RSpec.describe DynamodbRecord::Config, :vcr do
4
-
5
4
  after do
6
5
  DynamodbRecord::Config.set_defaults
7
6
  end
@@ -25,4 +24,4 @@ RSpec.describe DynamodbRecord::Config, :vcr do
25
24
  expect(DynamodbRecord::Config.region).to eq('region')
26
25
  expect(DynamodbRecord::Config.namespace).to eq('fleteo-v2')
27
26
  end
28
- end
27
+ end
@@ -20,7 +20,7 @@ RSpec.describe DynamodbRecord::Query, :vcr do
20
20
  it 'returns records by limit' do
21
21
  result = User.where(balance: 0, limit: 1)
22
22
  expect(result.count).to eq(1)
23
- expect(result.last_evaluated_key).to eq({'id'=>'hguzman20@gmail.com'})
23
+ expect(result.last_evaluated_key).to eq({'id' => 'hguzman20@gmail.com'})
24
24
  end
25
25
  end
26
26
  end
@@ -14,18 +14,18 @@ http_interactions:
14
14
  X-Amz-Target:
15
15
  - DynamoDB_20120810.GetItem
16
16
  User-Agent:
17
- - aws-sdk-ruby3/3.191.3 ua/2.0 api/dynamodb#1.105.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
17
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
18
18
  md/3.2.3 cfg/retry-mode#legacy
19
19
  Host:
20
20
  - localhost:8000
21
21
  X-Amz-Date:
22
- - 20240514T150857Z
22
+ - 20240520T003542Z
23
23
  X-Amz-Content-Sha256:
24
24
  - 3f40080fdb7ac1732232c14b86645a9ffbd3f94cf8ecda6b3c584d105288bb8d
25
25
  Authorization:
26
- - AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
26
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
27
27
  SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
28
- Signature=7b342a18382670246dd411ab6773fb2c99478d532b07d554e20c6212c0f9bc89
28
+ Signature=e290166c48b3a82f6c90fa7def3044bf3e38387ef56024156d0345dc650783f3
29
29
  Content-Length:
30
30
  - '58'
31
31
  Accept:
@@ -36,9 +36,9 @@ http_interactions:
36
36
  message: OK
37
37
  headers:
38
38
  Date:
39
- - Tue, 14 May 2024 15:08:57 GMT
39
+ - Mon, 20 May 2024 00:35:42 GMT
40
40
  X-Amzn-Requestid:
41
- - 4d417ee2-ef68-41f9-a96a-b494f7aa75e8
41
+ - 2a10dee7-9021-4f40-bdea-21da5594c80c
42
42
  Content-Type:
43
43
  - application/x-amz-json-1.0
44
44
  X-Amz-Crc32:
@@ -50,7 +50,7 @@ http_interactions:
50
50
  body:
51
51
  encoding: UTF-8
52
52
  string: '{"Item":{"marca":{"S":"Chvrolet"},"created_at":{"S":"2024-05-07T14:09:25-05:00"},"id":{"S":"UVX455"},"updated_at":{"S":"2024-05-07T14:09:25-05:00"}}}'
53
- recorded_at: Tue, 14 May 2024 15:08:57 GMT
53
+ recorded_at: Mon, 20 May 2024 00:35:42 GMT
54
54
  - request:
55
55
  method: post
56
56
  uri: http://localhost:8000/
@@ -66,18 +66,18 @@ http_interactions:
66
66
  X-Amz-Target:
67
67
  - DynamoDB_20120810.Query
68
68
  User-Agent:
69
- - aws-sdk-ruby3/3.191.3 ua/2.0 api/dynamodb#1.105.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
69
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
70
70
  md/3.2.3 cfg/retry-mode#legacy
71
71
  Host:
72
72
  - localhost:8000
73
73
  X-Amz-Date:
74
- - 20240514T150857Z
74
+ - 20240520T003542Z
75
75
  X-Amz-Content-Sha256:
76
76
  - cace0a22d92863fee1a25aaedd2a1d186e28b09ab69c98bf43ee1e5d1e62dc78
77
77
  Authorization:
78
- - AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
78
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
79
79
  SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
80
- Signature=061e838c38387334ef4c00e006a3277a10a1a6bcf05a52d33366e52ca09e0fe5
80
+ Signature=13d89cfb1a3c3246bb72eac363f307b42965945af3986cab6fd7414ea4fb25df
81
81
  Content-Length:
82
82
  - '184'
83
83
  Accept:
@@ -88,21 +88,21 @@ http_interactions:
88
88
  message: OK
89
89
  headers:
90
90
  Date:
91
- - Tue, 14 May 2024 15:08:57 GMT
91
+ - Mon, 20 May 2024 00:35:42 GMT
92
92
  X-Amzn-Requestid:
93
- - 928a6943-b6c4-4a19-845a-1f89e3ed11c5
93
+ - c9c00b02-5bb0-4423-9249-899ccdfacfc9
94
94
  Content-Type:
95
95
  - application/x-amz-json-1.0
96
96
  X-Amz-Crc32:
97
- - '1919856377'
97
+ - '2919407285'
98
98
  Content-Length:
99
- - '102'
99
+ - '213'
100
100
  Server:
101
101
  - Jetty(11.0.17)
102
102
  body:
103
103
  encoding: UTF-8
104
- string: '{"Items":[{"user_id":{"S":"hguzman10@gmail.com"},"car_id":{"S":"UVX455"}}],"Count":1,"ScannedCount":1}'
105
- recorded_at: Tue, 14 May 2024 15:08:57 GMT
104
+ string: '{"Items":[{"user_id":{"S":"hguzman10@gmail.com"},"car_id":{"S":"UVX455"},"created_at":{"S":"2024-05-19T19:14:10-05:00"}},{"user_id":{"S":"hguzman30@gmail.com"},"car_id":{"S":"UVX455"}}],"Count":2,"ScannedCount":2}'
105
+ recorded_at: Mon, 20 May 2024 00:35:42 GMT
106
106
  - request:
107
107
  method: post
108
108
  uri: http://localhost:8000/
@@ -117,18 +117,18 @@ http_interactions:
117
117
  X-Amz-Target:
118
118
  - DynamoDB_20120810.GetItem
119
119
  User-Agent:
120
- - aws-sdk-ruby3/3.191.3 ua/2.0 api/dynamodb#1.105.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
120
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
121
121
  md/3.2.3 cfg/retry-mode#legacy
122
122
  Host:
123
123
  - localhost:8000
124
124
  X-Amz-Date:
125
- - 20240514T150857Z
125
+ - 20240520T003542Z
126
126
  X-Amz-Content-Sha256:
127
127
  - ab20f394f9f17ab85359c8cef098ff2e93991ca4f4f9402376eaa33ea97d5545
128
128
  Authorization:
129
- - AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
129
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
130
130
  SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
131
- Signature=91872537c56776cac01ca40cb64b82fcde77bb64b8b3dd1b4e698e0c1225f847
131
+ Signature=f111a1c527e261480f45793ecc8a675ed8d09fae81a188d3a758ce3a719c53b7
132
132
  Content-Length:
133
133
  - '72'
134
134
  Accept:
@@ -139,27 +139,78 @@ http_interactions:
139
139
  message: OK
140
140
  headers:
141
141
  Date:
142
- - Tue, 14 May 2024 15:08:57 GMT
142
+ - Mon, 20 May 2024 00:35:42 GMT
143
143
  X-Amzn-Requestid:
144
- - 5b8bed75-6639-42a2-822a-df4697c22953
144
+ - 4015f9f2-51f3-4643-8a33-124c9d6d1175
145
145
  Content-Type:
146
146
  - application/x-amz-json-1.0
147
147
  X-Amz-Crc32:
148
- - '3262869781'
148
+ - '2698900000'
149
+ Content-Length:
150
+ - '247'
151
+ Server:
152
+ - Jetty(11.0.17)
153
+ body:
154
+ encoding: UTF-8
155
+ string: '{"Item":{"code":{"N":"2133"},"balance":{"N":"10"},"updated_at":{"S":"2024-05-14T13:48:27-05:00"},"overdraft":{"N":"0"},"roles":{"L":[{"S":"admin"},{"S":"assitant"}]},"created_at":{"S":"2024-05-14T13:48:27-05:00"},"id":{"S":"hguzman10@gmail.com"}}}'
156
+ recorded_at: Mon, 20 May 2024 00:35:42 GMT
157
+ - request:
158
+ method: post
159
+ uri: http://localhost:8000/
160
+ body:
161
+ encoding: UTF-8
162
+ string: '{"TableName":"fleteo-v2-users","Key":{"id":{"S":"hguzman30@gmail.com"}}}'
163
+ headers:
164
+ Accept-Encoding:
165
+ - ''
166
+ Content-Type:
167
+ - application/x-amz-json-1.0
168
+ X-Amz-Target:
169
+ - DynamoDB_20120810.GetItem
170
+ User-Agent:
171
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
172
+ md/3.2.3 cfg/retry-mode#legacy
173
+ Host:
174
+ - localhost:8000
175
+ X-Amz-Date:
176
+ - 20240520T003542Z
177
+ X-Amz-Content-Sha256:
178
+ - a79dcb92885a84695d4b1862815eea675a96021cd0385eb31b4c9bd91074dd19
179
+ Authorization:
180
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
181
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
182
+ Signature=2d2da4ef48638ff5f344d1d5aa11334f7dff2c9a2d6ce7615bda85b932661523
183
+ Content-Length:
184
+ - '72'
185
+ Accept:
186
+ - "*/*"
187
+ response:
188
+ status:
189
+ code: 200
190
+ message: OK
191
+ headers:
192
+ Date:
193
+ - Mon, 20 May 2024 00:35:42 GMT
194
+ X-Amzn-Requestid:
195
+ - 558bdb15-24eb-4d9a-8304-4f4abb641fe5
196
+ Content-Type:
197
+ - application/x-amz-json-1.0
198
+ X-Amz-Crc32:
199
+ - '941944394'
149
200
  Content-Length:
150
201
  - '157'
151
202
  Server:
152
203
  - Jetty(11.0.17)
153
204
  body:
154
205
  encoding: UTF-8
155
- string: '{"Item":{"created_at":{"S":"2024-05-07T14:10:09-05:00"},"id":{"S":"hguzman10@gmail.com"},"balance":{"N":"0"},"updated_at":{"S":"2024-05-07T14:10:09-05:00"}}}'
156
- recorded_at: Tue, 14 May 2024 15:08:57 GMT
206
+ string: '{"Item":{"created_at":{"S":"2024-05-08T12:22:30-05:00"},"id":{"S":"hguzman30@gmail.com"},"balance":{"N":"0"},"updated_at":{"S":"2024-05-08T12:22:30-05:00"}}}'
207
+ recorded_at: Mon, 20 May 2024 00:35:42 GMT
157
208
  - request:
158
209
  method: post
159
210
  uri: http://localhost:8000/
160
211
  body:
161
212
  encoding: UTF-8
162
- string: '{"TableName":"fleteo-v2-users","Item":{"balance":{"N":"0"},"id":{"S":"hguzman50@gmail.com"},"created_at":{"S":"2024-05-14T10:08:57-05:00"},"updated_at":{"S":"2024-05-14T10:08:57-05:00"}}}'
213
+ string: '{"TableName":"fleteo-v2-users","Item":{"balance":{"N":"0"},"id":{"S":"hguzman50@gmail.com"},"created_at":{"S":"2024-05-19T19:35:42-05:00"},"updated_at":{"S":"2024-05-19T19:35:42-05:00"}}}'
163
214
  headers:
164
215
  Accept-Encoding:
165
216
  - ''
@@ -168,18 +219,18 @@ http_interactions:
168
219
  X-Amz-Target:
169
220
  - DynamoDB_20120810.PutItem
170
221
  User-Agent:
171
- - aws-sdk-ruby3/3.191.3 ua/2.0 api/dynamodb#1.105.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
222
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
172
223
  md/3.2.3 cfg/retry-mode#legacy
173
224
  Host:
174
225
  - localhost:8000
175
226
  X-Amz-Date:
176
- - 20240514T150857Z
227
+ - 20240520T003542Z
177
228
  X-Amz-Content-Sha256:
178
- - 3ad6c8463801ae079ca7f7ec94c2e2a791d16e713a736cd9f11ed3e219ea0964
229
+ - 970aede97396ac2cba7508fff079b38ecf04c1638576b616ddfce6c6fa836f07
179
230
  Authorization:
180
- - AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
231
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
181
232
  SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
182
- Signature=27d7745ec37b37e7c19b8baf1cf88045f0e95b7f51e0ffed8862f8e3e0db36c5
233
+ Signature=376962f4fdfcc2cd9c950f305823b247b8015c8f2cbd70c9501d9bca060d73f1
183
234
  Content-Length:
184
235
  - '187'
185
236
  Accept:
@@ -190,9 +241,9 @@ http_interactions:
190
241
  message: OK
191
242
  headers:
192
243
  Date:
193
- - Tue, 14 May 2024 15:08:57 GMT
244
+ - Mon, 20 May 2024 00:35:42 GMT
194
245
  X-Amzn-Requestid:
195
- - 0ba821b4-96b4-4f07-a4fe-63ee94603d94
246
+ - 1719b7cc-f1ef-4fba-ac84-77338c1d9997
196
247
  Content-Type:
197
248
  - application/x-amz-json-1.0
198
249
  X-Amz-Crc32:
@@ -204,13 +255,13 @@ http_interactions:
204
255
  body:
205
256
  encoding: UTF-8
206
257
  string: "{}"
207
- recorded_at: Tue, 14 May 2024 15:08:57 GMT
258
+ recorded_at: Mon, 20 May 2024 00:35:42 GMT
208
259
  - request:
209
260
  method: post
210
261
  uri: http://localhost:8000/
211
262
  body:
212
263
  encoding: UTF-8
213
- string: '{"TableName":"fleteo-v2-cars-users","Item":{"car_id":{"S":"UVX455"},"user_id":{"S":"hguzman50@gmail.com"}}}'
264
+ string: '{"TableName":"fleteo-v2-cars-users","Item":{"car_id":{"S":"UVX455"},"user_id":{"S":"hguzman50@gmail.com"},"created_at":{"S":"2024-05-19T19:35:42-05:00"}}}'
214
265
  headers:
215
266
  Accept-Encoding:
216
267
  - ''
@@ -219,20 +270,20 @@ http_interactions:
219
270
  X-Amz-Target:
220
271
  - DynamoDB_20120810.PutItem
221
272
  User-Agent:
222
- - aws-sdk-ruby3/3.191.3 ua/2.0 api/dynamodb#1.105.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
273
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
223
274
  md/3.2.3 cfg/retry-mode#legacy
224
275
  Host:
225
276
  - localhost:8000
226
277
  X-Amz-Date:
227
- - 20240514T150857Z
278
+ - 20240520T003542Z
228
279
  X-Amz-Content-Sha256:
229
- - d5b220f0a13a3cedb9b4d4b1eb2b48b14c66738be9e9690a12290e570ad3262d
280
+ - e0fa19df10231bf2ec43fca85826fbf3e97470f3f201acf8d1501227c32e268c
230
281
  Authorization:
231
- - AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
282
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
232
283
  SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
233
- Signature=4daab6481522dc81dc65d32bd749ac3e60d3577b28344b1b463eb473c7d1e718
284
+ Signature=198096d9ccbeef2716208ed675b3f19992e322c508faa7cf797f480459db7910
234
285
  Content-Length:
235
- - '107'
286
+ - '154'
236
287
  Accept:
237
288
  - "*/*"
238
289
  response:
@@ -241,9 +292,9 @@ http_interactions:
241
292
  message: OK
242
293
  headers:
243
294
  Date:
244
- - Tue, 14 May 2024 15:08:57 GMT
295
+ - Mon, 20 May 2024 00:35:42 GMT
245
296
  X-Amzn-Requestid:
246
- - 43c4093e-afb1-4ba1-a57a-2d1d75fb1580
297
+ - 205a69bf-5737-42f2-abb4-5cb12c44b364
247
298
  Content-Type:
248
299
  - application/x-amz-json-1.0
249
300
  X-Amz-Crc32:
@@ -255,5 +306,5 @@ http_interactions:
255
306
  body:
256
307
  encoding: UTF-8
257
308
  string: "{}"
258
- recorded_at: Tue, 14 May 2024 15:08:57 GMT
309
+ recorded_at: Mon, 20 May 2024 00:35:42 GMT
259
310
  recorded_with: VCR 6.2.0
@@ -0,0 +1,362 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:8000/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"TableName":"fleteo-v2-cars","Key":{"id":{"S":"UVX455"}}}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - ''
12
+ Content-Type:
13
+ - application/x-amz-json-1.0
14
+ X-Amz-Target:
15
+ - DynamoDB_20120810.GetItem
16
+ User-Agent:
17
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
18
+ md/3.2.3 cfg/retry-mode#legacy
19
+ Host:
20
+ - localhost:8000
21
+ X-Amz-Date:
22
+ - 20240520T010348Z
23
+ X-Amz-Content-Sha256:
24
+ - 3f40080fdb7ac1732232c14b86645a9ffbd3f94cf8ecda6b3c584d105288bb8d
25
+ Authorization:
26
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
27
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
28
+ Signature=c40d998b401acb2c38f489e483a33197fce26391f31f0ab1be82e2602e21d75b
29
+ Content-Length:
30
+ - '58'
31
+ Accept:
32
+ - "*/*"
33
+ response:
34
+ status:
35
+ code: 200
36
+ message: OK
37
+ headers:
38
+ Date:
39
+ - Mon, 20 May 2024 01:03:48 GMT
40
+ X-Amzn-Requestid:
41
+ - ad51bd93-6dfb-42e1-8ea0-dc9d92b6101d
42
+ Content-Type:
43
+ - application/x-amz-json-1.0
44
+ X-Amz-Crc32:
45
+ - '590923779'
46
+ Content-Length:
47
+ - '149'
48
+ Server:
49
+ - Jetty(11.0.17)
50
+ body:
51
+ encoding: UTF-8
52
+ string: '{"Item":{"marca":{"S":"Chvrolet"},"created_at":{"S":"2024-05-07T14:09:25-05:00"},"id":{"S":"UVX455"},"updated_at":{"S":"2024-05-07T14:09:25-05:00"}}}'
53
+ recorded_at: Mon, 20 May 2024 01:03:48 GMT
54
+ - request:
55
+ method: post
56
+ uri: http://localhost:8000/
57
+ body:
58
+ encoding: UTF-8
59
+ string: '{"TableName":"fleteo-v2-users","Key":{"id":{"S":"hguzman50@gmail.com"}}}'
60
+ headers:
61
+ Accept-Encoding:
62
+ - ''
63
+ Content-Type:
64
+ - application/x-amz-json-1.0
65
+ X-Amz-Target:
66
+ - DynamoDB_20120810.GetItem
67
+ User-Agent:
68
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
69
+ md/3.2.3 cfg/retry-mode#legacy
70
+ Host:
71
+ - localhost:8000
72
+ X-Amz-Date:
73
+ - 20240520T010348Z
74
+ X-Amz-Content-Sha256:
75
+ - 5b07a2ed9f61d6478feb52e761428fdcb93c27759f2c71d11f9eeaf0a7c6fd82
76
+ Authorization:
77
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
78
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
79
+ Signature=497ece2c605608f67ed7b29179e97b3f1dba08ee33449840240d2cad606a6769
80
+ Content-Length:
81
+ - '72'
82
+ Accept:
83
+ - "*/*"
84
+ response:
85
+ status:
86
+ code: 200
87
+ message: OK
88
+ headers:
89
+ Date:
90
+ - Mon, 20 May 2024 01:03:48 GMT
91
+ X-Amzn-Requestid:
92
+ - c4634beb-9d5c-446a-9761-5ef0add5da53
93
+ Content-Type:
94
+ - application/x-amz-json-1.0
95
+ X-Amz-Crc32:
96
+ - '812259017'
97
+ Content-Length:
98
+ - '157'
99
+ Server:
100
+ - Jetty(11.0.17)
101
+ body:
102
+ encoding: UTF-8
103
+ string: '{"Item":{"created_at":{"S":"2024-05-19T19:35:42-05:00"},"id":{"S":"hguzman50@gmail.com"},"balance":{"N":"0"},"updated_at":{"S":"2024-05-19T19:35:42-05:00"}}}'
104
+ recorded_at: Mon, 20 May 2024 01:03:48 GMT
105
+ - request:
106
+ method: post
107
+ uri: http://localhost:8000/
108
+ body:
109
+ encoding: UTF-8
110
+ string: '{"TableName":"fleteo-v2-cars-users","KeyConditionExpression":"#car_id
111
+ = :car_id","ExpressionAttributeNames":{"#car_id":"car_id"},"ExpressionAttributeValues":{":car_id":{"S":"UVX455"}}}'
112
+ headers:
113
+ Accept-Encoding:
114
+ - ''
115
+ Content-Type:
116
+ - application/x-amz-json-1.0
117
+ X-Amz-Target:
118
+ - DynamoDB_20120810.Query
119
+ User-Agent:
120
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
121
+ md/3.2.3 cfg/retry-mode#legacy
122
+ Host:
123
+ - localhost:8000
124
+ X-Amz-Date:
125
+ - 20240520T010348Z
126
+ X-Amz-Content-Sha256:
127
+ - cace0a22d92863fee1a25aaedd2a1d186e28b09ab69c98bf43ee1e5d1e62dc78
128
+ Authorization:
129
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
130
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
131
+ Signature=a6725a464729ff301acd6bc652a09153994149158fe0f8850cde770c9afd5aa7
132
+ Content-Length:
133
+ - '184'
134
+ Accept:
135
+ - "*/*"
136
+ response:
137
+ status:
138
+ code: 200
139
+ message: OK
140
+ headers:
141
+ Date:
142
+ - Mon, 20 May 2024 01:03:48 GMT
143
+ X-Amzn-Requestid:
144
+ - aad37e02-e9d7-4c3e-b1d4-20060d837f33
145
+ Content-Type:
146
+ - application/x-amz-json-1.0
147
+ X-Amz-Crc32:
148
+ - '2919407285'
149
+ Content-Length:
150
+ - '213'
151
+ Server:
152
+ - Jetty(11.0.17)
153
+ body:
154
+ encoding: UTF-8
155
+ string: '{"Items":[{"user_id":{"S":"hguzman10@gmail.com"},"car_id":{"S":"UVX455"},"created_at":{"S":"2024-05-19T19:14:10-05:00"}},{"user_id":{"S":"hguzman30@gmail.com"},"car_id":{"S":"UVX455"}}],"Count":2,"ScannedCount":2}'
156
+ recorded_at: Mon, 20 May 2024 01:03:48 GMT
157
+ - request:
158
+ method: post
159
+ uri: http://localhost:8000/
160
+ body:
161
+ encoding: UTF-8
162
+ string: '{"TableName":"fleteo-v2-users","Key":{"id":{"S":"hguzman10@gmail.com"}}}'
163
+ headers:
164
+ Accept-Encoding:
165
+ - ''
166
+ Content-Type:
167
+ - application/x-amz-json-1.0
168
+ X-Amz-Target:
169
+ - DynamoDB_20120810.GetItem
170
+ User-Agent:
171
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
172
+ md/3.2.3 cfg/retry-mode#legacy
173
+ Host:
174
+ - localhost:8000
175
+ X-Amz-Date:
176
+ - 20240520T010348Z
177
+ X-Amz-Content-Sha256:
178
+ - ab20f394f9f17ab85359c8cef098ff2e93991ca4f4f9402376eaa33ea97d5545
179
+ Authorization:
180
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
181
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
182
+ Signature=c3e2715820142c0e52b0764ac4e60d46e93c4be56643a88bce2d009c9ad2192a
183
+ Content-Length:
184
+ - '72'
185
+ Accept:
186
+ - "*/*"
187
+ response:
188
+ status:
189
+ code: 200
190
+ message: OK
191
+ headers:
192
+ Date:
193
+ - Mon, 20 May 2024 01:03:48 GMT
194
+ X-Amzn-Requestid:
195
+ - 6772cd02-ef8b-465e-a129-bfe3e0f44710
196
+ Content-Type:
197
+ - application/x-amz-json-1.0
198
+ X-Amz-Crc32:
199
+ - '2698900000'
200
+ Content-Length:
201
+ - '247'
202
+ Server:
203
+ - Jetty(11.0.17)
204
+ body:
205
+ encoding: UTF-8
206
+ string: '{"Item":{"code":{"N":"2133"},"balance":{"N":"10"},"updated_at":{"S":"2024-05-14T13:48:27-05:00"},"overdraft":{"N":"0"},"roles":{"L":[{"S":"admin"},{"S":"assitant"}]},"created_at":{"S":"2024-05-14T13:48:27-05:00"},"id":{"S":"hguzman10@gmail.com"}}}'
207
+ recorded_at: Mon, 20 May 2024 01:03:48 GMT
208
+ - request:
209
+ method: post
210
+ uri: http://localhost:8000/
211
+ body:
212
+ encoding: UTF-8
213
+ string: '{"TableName":"fleteo-v2-users","Key":{"id":{"S":"hguzman30@gmail.com"}}}'
214
+ headers:
215
+ Accept-Encoding:
216
+ - ''
217
+ Content-Type:
218
+ - application/x-amz-json-1.0
219
+ X-Amz-Target:
220
+ - DynamoDB_20120810.GetItem
221
+ User-Agent:
222
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
223
+ md/3.2.3 cfg/retry-mode#legacy
224
+ Host:
225
+ - localhost:8000
226
+ X-Amz-Date:
227
+ - 20240520T010348Z
228
+ X-Amz-Content-Sha256:
229
+ - a79dcb92885a84695d4b1862815eea675a96021cd0385eb31b4c9bd91074dd19
230
+ Authorization:
231
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
232
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
233
+ Signature=a81526032241dd1f4141e4a76963414211960bf561fdd5e911a08a7f2836cb8e
234
+ Content-Length:
235
+ - '72'
236
+ Accept:
237
+ - "*/*"
238
+ response:
239
+ status:
240
+ code: 200
241
+ message: OK
242
+ headers:
243
+ Date:
244
+ - Mon, 20 May 2024 01:03:48 GMT
245
+ X-Amzn-Requestid:
246
+ - f2bc90c1-e1d4-478c-99da-1fb1dcf69ee4
247
+ Content-Type:
248
+ - application/x-amz-json-1.0
249
+ X-Amz-Crc32:
250
+ - '941944394'
251
+ Content-Length:
252
+ - '157'
253
+ Server:
254
+ - Jetty(11.0.17)
255
+ body:
256
+ encoding: UTF-8
257
+ string: '{"Item":{"created_at":{"S":"2024-05-08T12:22:30-05:00"},"id":{"S":"hguzman30@gmail.com"},"balance":{"N":"0"},"updated_at":{"S":"2024-05-08T12:22:30-05:00"}}}'
258
+ recorded_at: Mon, 20 May 2024 01:03:48 GMT
259
+ - request:
260
+ method: post
261
+ uri: http://localhost:8000/
262
+ body:
263
+ encoding: UTF-8
264
+ string: '{"TableName":"fleteo-v2-cars-users","Key":{"car_id":{"S":"UVX455"},"user_id":{"S":"hguzman50@gmail.com"}}}'
265
+ headers:
266
+ Accept-Encoding:
267
+ - ''
268
+ Content-Type:
269
+ - application/x-amz-json-1.0
270
+ X-Amz-Target:
271
+ - DynamoDB_20120810.DeleteItem
272
+ User-Agent:
273
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
274
+ md/3.2.3 cfg/retry-mode#legacy
275
+ Host:
276
+ - localhost:8000
277
+ X-Amz-Date:
278
+ - 20240520T010348Z
279
+ X-Amz-Content-Sha256:
280
+ - bd1b3ab9eebd13de1adae7dfb0b976aa915611cc123b93497c5431bff18aebcf
281
+ Authorization:
282
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
283
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
284
+ Signature=75736a2df1c57ebdb67be4b4b4c3eeb1e55986e640c654e34287140a0936d48c
285
+ Content-Length:
286
+ - '106'
287
+ Accept:
288
+ - "*/*"
289
+ response:
290
+ status:
291
+ code: 200
292
+ message: OK
293
+ headers:
294
+ Date:
295
+ - Mon, 20 May 2024 01:03:48 GMT
296
+ X-Amzn-Requestid:
297
+ - 53084359-5132-4709-9fd7-233eceedb586
298
+ Content-Type:
299
+ - application/x-amz-json-1.0
300
+ X-Amz-Crc32:
301
+ - '1734830147'
302
+ Content-Length:
303
+ - '77'
304
+ Server:
305
+ - Jetty(11.0.17)
306
+ body:
307
+ encoding: UTF-8
308
+ string: '{"ConsumedCapacity":{"TableName":"fleteo-v2-cars-users","CapacityUnits":1.0}}'
309
+ recorded_at: Mon, 20 May 2024 01:03:48 GMT
310
+ - request:
311
+ method: post
312
+ uri: http://localhost:8000/
313
+ body:
314
+ encoding: UTF-8
315
+ string: '{"TableName":"fleteo-v2-cars-users","IndexName":"fleteo-v2-cars-users-index","KeyConditionExpression":"#user_id
316
+ = :user_id","ExpressionAttributeNames":{"#user_id":"user_id"},"ExpressionAttributeValues":{":user_id":{"S":"hguzman50@gmail.com"}}}'
317
+ headers:
318
+ Accept-Encoding:
319
+ - ''
320
+ Content-Type:
321
+ - application/x-amz-json-1.0
322
+ X-Amz-Target:
323
+ - DynamoDB_20120810.Query
324
+ User-Agent:
325
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
326
+ md/3.2.3 cfg/retry-mode#legacy
327
+ Host:
328
+ - localhost:8000
329
+ X-Amz-Date:
330
+ - 20240520T010348Z
331
+ X-Amz-Content-Sha256:
332
+ - e8ef0f448ceb63458a2b22de0310588dc855cc3de976fb9c72d10263f3d5e818
333
+ Authorization:
334
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
335
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
336
+ Signature=c9c42fb555e7ef33ec14c37e1387aab15a7dad2482c0820399f9131624942066
337
+ Content-Length:
338
+ - '243'
339
+ Accept:
340
+ - "*/*"
341
+ response:
342
+ status:
343
+ code: 200
344
+ message: OK
345
+ headers:
346
+ Date:
347
+ - Mon, 20 May 2024 01:03:48 GMT
348
+ X-Amzn-Requestid:
349
+ - 50b35735-1a86-4066-8606-1bde5cbe9040
350
+ Content-Type:
351
+ - application/x-amz-json-1.0
352
+ X-Amz-Crc32:
353
+ - '583912891'
354
+ Content-Length:
355
+ - '39'
356
+ Server:
357
+ - Jetty(11.0.17)
358
+ body:
359
+ encoding: UTF-8
360
+ string: '{"Items":[],"Count":0,"ScannedCount":0}'
361
+ recorded_at: Mon, 20 May 2024 01:03:48 GMT
362
+ recorded_with: VCR 6.2.0
@@ -0,0 +1,208 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:8000/
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"TableName":"fleteo-v2-cars","Key":{"id":{"S":"UVX455"}}}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - ''
12
+ Content-Type:
13
+ - application/x-amz-json-1.0
14
+ X-Amz-Target:
15
+ - DynamoDB_20120810.GetItem
16
+ User-Agent:
17
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
18
+ md/3.2.3 cfg/retry-mode#legacy
19
+ Host:
20
+ - localhost:8000
21
+ X-Amz-Date:
22
+ - 20240520T001410Z
23
+ X-Amz-Content-Sha256:
24
+ - 3f40080fdb7ac1732232c14b86645a9ffbd3f94cf8ecda6b3c584d105288bb8d
25
+ Authorization:
26
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
27
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
28
+ Signature=da572e06a0addb93238efb56f17b7e30577c8cea8a99f076cc626a21dc701f22
29
+ Content-Length:
30
+ - '58'
31
+ Accept:
32
+ - "*/*"
33
+ response:
34
+ status:
35
+ code: 200
36
+ message: OK
37
+ headers:
38
+ Date:
39
+ - Mon, 20 May 2024 00:14:10 GMT
40
+ X-Amzn-Requestid:
41
+ - b316b1f1-b91f-467d-9c57-eb5277021442
42
+ Content-Type:
43
+ - application/x-amz-json-1.0
44
+ X-Amz-Crc32:
45
+ - '590923779'
46
+ Content-Length:
47
+ - '149'
48
+ Server:
49
+ - Jetty(11.0.17)
50
+ body:
51
+ encoding: UTF-8
52
+ string: '{"Item":{"marca":{"S":"Chvrolet"},"created_at":{"S":"2024-05-07T14:09:25-05:00"},"id":{"S":"UVX455"},"updated_at":{"S":"2024-05-07T14:09:25-05:00"}}}'
53
+ recorded_at: Mon, 20 May 2024 00:14:10 GMT
54
+ - request:
55
+ method: post
56
+ uri: http://localhost:8000/
57
+ body:
58
+ encoding: UTF-8
59
+ string: '{"TableName":"fleteo-v2-users","Key":{"id":{"S":"hguzman10@gmail.com"}}}'
60
+ headers:
61
+ Accept-Encoding:
62
+ - ''
63
+ Content-Type:
64
+ - application/x-amz-json-1.0
65
+ X-Amz-Target:
66
+ - DynamoDB_20120810.GetItem
67
+ User-Agent:
68
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
69
+ md/3.2.3 cfg/retry-mode#legacy
70
+ Host:
71
+ - localhost:8000
72
+ X-Amz-Date:
73
+ - 20240520T001410Z
74
+ X-Amz-Content-Sha256:
75
+ - ab20f394f9f17ab85359c8cef098ff2e93991ca4f4f9402376eaa33ea97d5545
76
+ Authorization:
77
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
78
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
79
+ Signature=9a3015d1fc47dff2839194bac3eec33adbe1f6432cffda0db72a03d15979aa3e
80
+ Content-Length:
81
+ - '72'
82
+ Accept:
83
+ - "*/*"
84
+ response:
85
+ status:
86
+ code: 200
87
+ message: OK
88
+ headers:
89
+ Date:
90
+ - Mon, 20 May 2024 00:14:10 GMT
91
+ X-Amzn-Requestid:
92
+ - cf80a068-96fd-49af-b9ee-9154d8432e4e
93
+ Content-Type:
94
+ - application/x-amz-json-1.0
95
+ X-Amz-Crc32:
96
+ - '2698900000'
97
+ Content-Length:
98
+ - '247'
99
+ Server:
100
+ - Jetty(11.0.17)
101
+ body:
102
+ encoding: UTF-8
103
+ string: '{"Item":{"code":{"N":"2133"},"balance":{"N":"10"},"updated_at":{"S":"2024-05-14T13:48:27-05:00"},"overdraft":{"N":"0"},"roles":{"L":[{"S":"admin"},{"S":"assitant"}]},"created_at":{"S":"2024-05-14T13:48:27-05:00"},"id":{"S":"hguzman10@gmail.com"}}}'
104
+ recorded_at: Mon, 20 May 2024 00:14:10 GMT
105
+ - request:
106
+ method: post
107
+ uri: http://localhost:8000/
108
+ body:
109
+ encoding: UTF-8
110
+ string: '{"TableName":"fleteo-v2-cars-users","IndexName":"fleteo-v2-cars-users-index","KeyConditionExpression":"#user_id
111
+ = :user_id","ExpressionAttributeNames":{"#user_id":"user_id"},"ExpressionAttributeValues":{":user_id":{"S":"hguzman10@gmail.com"}}}'
112
+ headers:
113
+ Accept-Encoding:
114
+ - ''
115
+ Content-Type:
116
+ - application/x-amz-json-1.0
117
+ X-Amz-Target:
118
+ - DynamoDB_20120810.Query
119
+ User-Agent:
120
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
121
+ md/3.2.3 cfg/retry-mode#legacy
122
+ Host:
123
+ - localhost:8000
124
+ X-Amz-Date:
125
+ - 20240520T001410Z
126
+ X-Amz-Content-Sha256:
127
+ - 0175d24f36fe98a611d5abdc67ddc83bb5d7192f7b6330d0014ace2323300f43
128
+ Authorization:
129
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
130
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
131
+ Signature=73b03a8f2e739330007441ceeaf17a471cb1d95cd9c1ccab956c9433e46a6194
132
+ Content-Length:
133
+ - '243'
134
+ Accept:
135
+ - "*/*"
136
+ response:
137
+ status:
138
+ code: 200
139
+ message: OK
140
+ headers:
141
+ Date:
142
+ - Mon, 20 May 2024 00:14:10 GMT
143
+ X-Amzn-Requestid:
144
+ - 347c8413-a90b-4513-be66-159b1b3671d2
145
+ Content-Type:
146
+ - application/x-amz-json-1.0
147
+ X-Amz-Crc32:
148
+ - '583912891'
149
+ Content-Length:
150
+ - '39'
151
+ Server:
152
+ - Jetty(11.0.17)
153
+ body:
154
+ encoding: UTF-8
155
+ string: '{"Items":[],"Count":0,"ScannedCount":0}'
156
+ recorded_at: Mon, 20 May 2024 00:14:10 GMT
157
+ - request:
158
+ method: post
159
+ uri: http://localhost:8000/
160
+ body:
161
+ encoding: UTF-8
162
+ string: '{"TableName":"fleteo-v2-cars-users","Item":{"user_id":{"S":"hguzman10@gmail.com"},"car_id":{"S":"UVX455"},"created_at":{"S":"2024-05-19T19:14:10-05:00"}}}'
163
+ headers:
164
+ Accept-Encoding:
165
+ - ''
166
+ Content-Type:
167
+ - application/x-amz-json-1.0
168
+ X-Amz-Target:
169
+ - DynamoDB_20120810.PutItem
170
+ User-Agent:
171
+ - aws-sdk-ruby3/3.191.6 ua/2.0 api/dynamodb#1.106.0 os/macos#20 md/x86_64 lang/ruby#3.2.3
172
+ md/3.2.3 cfg/retry-mode#legacy
173
+ Host:
174
+ - localhost:8000
175
+ X-Amz-Date:
176
+ - 20240520T001410Z
177
+ X-Amz-Content-Sha256:
178
+ - 7301eaa875597a1272b3c275a23a49cf2954a8131232a0348c61bbcbfc55d012
179
+ Authorization:
180
+ - AWS4-HMAC-SHA256 Credential=key/20240520/us-east-1/dynamodb/aws4_request,
181
+ SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
182
+ Signature=14bd70860dad47cf3297f5262521854c813802a7b06444aaaac98ce0a1c7fe39
183
+ Content-Length:
184
+ - '154'
185
+ Accept:
186
+ - "*/*"
187
+ response:
188
+ status:
189
+ code: 200
190
+ message: OK
191
+ headers:
192
+ Date:
193
+ - Mon, 20 May 2024 00:14:10 GMT
194
+ X-Amzn-Requestid:
195
+ - b3531926-2f0f-461b-bd31-742c3b27149c
196
+ Content-Type:
197
+ - application/x-amz-json-1.0
198
+ X-Amz-Crc32:
199
+ - '2745614147'
200
+ Content-Length:
201
+ - '2'
202
+ Server:
203
+ - Jetty(11.0.17)
204
+ body:
205
+ encoding: UTF-8
206
+ string: "{}"
207
+ recorded_at: Mon, 20 May 2024 00:14:10 GMT
208
+ recorded_with: VCR 6.2.0
data/spec/spec_helper.rb CHANGED
@@ -22,4 +22,3 @@ VCR.configure do |c|
22
22
  c.default_cassette_options = {match_requests_on: %i[method uri]}
23
23
  # c.default_cassette_options = { match_requests_on: %i[method uri body] }
24
24
  end
25
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamodb_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henry Guzman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-05-14 00:00:00.000000000 Z
12
+ date: 2024-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -202,11 +202,13 @@ files:
202
202
  - spec/dynamodb_record/persistence_spec.rb
203
203
  - spec/dynamodb_record/query_spec.rb
204
204
  - spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_belongs_to/get_object.yml
205
+ - spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_and_belongs_to_many/create.yml
206
+ - spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_and_belongs_to_many/destroy.yml
207
+ - spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_and_belongs_to_many/only_one_record.yml
205
208
  - spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/add_list.yml
206
209
  - spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/create_item.yml
207
210
  - spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/get_collection.yml
208
211
  - spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/has_and_belongs_to_many.yml
209
- - spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/has_and_belongs_to_many_create.yml
210
212
  - spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/has_many_through.yml
211
213
  - spec/fixtures/vcr_cassettes/DynamodbRecord_Document/initializes_from_database.yml
212
214
  - spec/fixtures/vcr_cassettes/DynamodbRecord_Fields/_find/finds_record.yml