dynamodb_record 0.4.0 → 0.4.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 +4 -4
- data/README.md +42 -0
- data/lib/dynamodb_record/has_and_belongs_to_many_collection.rb +15 -10
- data/lib/dynamodb_record/has_many_collection.rb +18 -0
- data/lib/dynamodb_record/persistence.rb +1 -1
- data/lib/dynamodb_record/version.rb +1 -1
- data/spec/dynamodb_record/association_spec.rb +7 -2
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_belongs_to/get_object.yml +28 -24
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_and_belongs_to_many/create.yml +67 -108
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_and_belongs_to_many/destroy.yml +84 -124
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_and_belongs_to_many/only_one_record.yml +52 -44
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/create_item.yml +41 -35
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/create_item_with_.yml +216 -0
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/get_collection.yml +28 -24
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/has_and_belongs_to_many.yml +41 -35
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/has_many_through.yml +28 -78
- metadata +3 -3
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/add_list.yml +0 -362
@@ -1,362 +0,0 @@
|
|
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-users","Key":{"id":{"S":"hguzman10@gmail.com"}}}'
|
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.3 ua/2.0 api/dynamodb#1.105.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
|
-
- 20240514T144620Z
|
23
|
-
X-Amz-Content-Sha256:
|
24
|
-
- ab20f394f9f17ab85359c8cef098ff2e93991ca4f4f9402376eaa33ea97d5545
|
25
|
-
Authorization:
|
26
|
-
- AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
|
27
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
|
28
|
-
Signature=7f40d5a6191a9532b51042f9e25b6d95ab08b5a9525610a8d4261cfcdaa3cf25
|
29
|
-
Content-Length:
|
30
|
-
- '72'
|
31
|
-
Accept:
|
32
|
-
- "*/*"
|
33
|
-
response:
|
34
|
-
status:
|
35
|
-
code: 200
|
36
|
-
message: OK
|
37
|
-
headers:
|
38
|
-
Date:
|
39
|
-
- Tue, 14 May 2024 14:46:20 GMT
|
40
|
-
X-Amzn-Requestid:
|
41
|
-
- 84007b4f-a47b-45c9-a341-a84c275c0031
|
42
|
-
Content-Type:
|
43
|
-
- application/x-amz-json-1.0
|
44
|
-
X-Amz-Crc32:
|
45
|
-
- '3262869781'
|
46
|
-
Content-Length:
|
47
|
-
- '157'
|
48
|
-
Server:
|
49
|
-
- Jetty(11.0.17)
|
50
|
-
body:
|
51
|
-
encoding: UTF-8
|
52
|
-
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"}}}'
|
53
|
-
recorded_at: Tue, 14 May 2024 14:46:20 GMT
|
54
|
-
- request:
|
55
|
-
method: post
|
56
|
-
uri: http://localhost:8000/
|
57
|
-
body:
|
58
|
-
encoding: UTF-8
|
59
|
-
string: '{"TableName":"fleteo-v2-cars","Key":{"id":{"S":"UVX455"}}}'
|
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.3 ua/2.0 api/dynamodb#1.105.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
|
-
- 20240514T144620Z
|
74
|
-
X-Amz-Content-Sha256:
|
75
|
-
- 3f40080fdb7ac1732232c14b86645a9ffbd3f94cf8ecda6b3c584d105288bb8d
|
76
|
-
Authorization:
|
77
|
-
- AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
|
78
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
|
79
|
-
Signature=a7aa82df282063303cea5d1f31b73ba19956d24c980a68b21e8e421d3d26e5b9
|
80
|
-
Content-Length:
|
81
|
-
- '58'
|
82
|
-
Accept:
|
83
|
-
- "*/*"
|
84
|
-
response:
|
85
|
-
status:
|
86
|
-
code: 200
|
87
|
-
message: OK
|
88
|
-
headers:
|
89
|
-
Date:
|
90
|
-
- Tue, 14 May 2024 14:46:20 GMT
|
91
|
-
X-Amzn-Requestid:
|
92
|
-
- ed4c55df-a4e8-4ba8-8a30-45ecd389362e
|
93
|
-
Content-Type:
|
94
|
-
- application/x-amz-json-1.0
|
95
|
-
X-Amz-Crc32:
|
96
|
-
- '590923779'
|
97
|
-
Content-Length:
|
98
|
-
- '149'
|
99
|
-
Server:
|
100
|
-
- Jetty(11.0.17)
|
101
|
-
body:
|
102
|
-
encoding: UTF-8
|
103
|
-
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"}}}'
|
104
|
-
recorded_at: Tue, 14 May 2024 14:46:20 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.3 ua/2.0 api/dynamodb#1.105.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
|
-
- 20240514T144620Z
|
126
|
-
X-Amz-Content-Sha256:
|
127
|
-
- 0175d24f36fe98a611d5abdc67ddc83bb5d7192f7b6330d0014ace2323300f43
|
128
|
-
Authorization:
|
129
|
-
- AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
|
130
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
|
131
|
-
Signature=37002d3bf5b8fefae8dd5333571d23b019cb94b2f4e2dc447a0724e126016367
|
132
|
-
Content-Length:
|
133
|
-
- '243'
|
134
|
-
Accept:
|
135
|
-
- "*/*"
|
136
|
-
response:
|
137
|
-
status:
|
138
|
-
code: 200
|
139
|
-
message: OK
|
140
|
-
headers:
|
141
|
-
Date:
|
142
|
-
- Tue, 14 May 2024 14:46:20 GMT
|
143
|
-
X-Amzn-Requestid:
|
144
|
-
- 643c1716-5124-400a-8cc9-a841255b8b37
|
145
|
-
Content-Type:
|
146
|
-
- application/x-amz-json-1.0
|
147
|
-
X-Amz-Crc32:
|
148
|
-
- '1919856377'
|
149
|
-
Content-Length:
|
150
|
-
- '102'
|
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"}}],"Count":1,"ScannedCount":1}'
|
156
|
-
recorded_at: Tue, 14 May 2024 14:46:20 GMT
|
157
|
-
- request:
|
158
|
-
method: post
|
159
|
-
uri: http://localhost:8000/
|
160
|
-
body:
|
161
|
-
encoding: UTF-8
|
162
|
-
string: '{"TableName":"fleteo-v2-cars","Key":{"id":{"S":"UVX455"}}}'
|
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.3 ua/2.0 api/dynamodb#1.105.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
|
-
- 20240514T144620Z
|
177
|
-
X-Amz-Content-Sha256:
|
178
|
-
- 3f40080fdb7ac1732232c14b86645a9ffbd3f94cf8ecda6b3c584d105288bb8d
|
179
|
-
Authorization:
|
180
|
-
- AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
|
181
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
|
182
|
-
Signature=a7aa82df282063303cea5d1f31b73ba19956d24c980a68b21e8e421d3d26e5b9
|
183
|
-
Content-Length:
|
184
|
-
- '58'
|
185
|
-
Accept:
|
186
|
-
- "*/*"
|
187
|
-
response:
|
188
|
-
status:
|
189
|
-
code: 200
|
190
|
-
message: OK
|
191
|
-
headers:
|
192
|
-
Date:
|
193
|
-
- Tue, 14 May 2024 14:46:20 GMT
|
194
|
-
X-Amzn-Requestid:
|
195
|
-
- 352f2964-36e4-4bfb-ad77-0b6f26ded9a9
|
196
|
-
Content-Type:
|
197
|
-
- application/x-amz-json-1.0
|
198
|
-
X-Amz-Crc32:
|
199
|
-
- '590923779'
|
200
|
-
Content-Length:
|
201
|
-
- '149'
|
202
|
-
Server:
|
203
|
-
- Jetty(11.0.17)
|
204
|
-
body:
|
205
|
-
encoding: UTF-8
|
206
|
-
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"}}}'
|
207
|
-
recorded_at: Tue, 14 May 2024 14:46:20 GMT
|
208
|
-
- request:
|
209
|
-
method: post
|
210
|
-
uri: http://localhost:8000/
|
211
|
-
body:
|
212
|
-
encoding: UTF-8
|
213
|
-
string: '{"TableName":"fleteo-v2-cars-users","Item":{"user_id":{"S":"hguzman10@gmail.com"},"car_id":{"S":"UVX455"}}}'
|
214
|
-
headers:
|
215
|
-
Accept-Encoding:
|
216
|
-
- ''
|
217
|
-
Content-Type:
|
218
|
-
- application/x-amz-json-1.0
|
219
|
-
X-Amz-Target:
|
220
|
-
- DynamoDB_20120810.PutItem
|
221
|
-
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
|
223
|
-
md/3.2.3 cfg/retry-mode#legacy
|
224
|
-
Host:
|
225
|
-
- localhost:8000
|
226
|
-
X-Amz-Date:
|
227
|
-
- 20240514T144620Z
|
228
|
-
X-Amz-Content-Sha256:
|
229
|
-
- 5520b7b4378bf3798b15afc5abcf3f33002f11b3a1880135a946e306c3c73862
|
230
|
-
Authorization:
|
231
|
-
- AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
|
232
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
|
233
|
-
Signature=a4887dad7be1e8f960cd0b14a963349dbc3ced008165315a4d16492595a3cafd
|
234
|
-
Content-Length:
|
235
|
-
- '107'
|
236
|
-
Accept:
|
237
|
-
- "*/*"
|
238
|
-
response:
|
239
|
-
status:
|
240
|
-
code: 200
|
241
|
-
message: OK
|
242
|
-
headers:
|
243
|
-
Date:
|
244
|
-
- Tue, 14 May 2024 14:46:20 GMT
|
245
|
-
X-Amzn-Requestid:
|
246
|
-
- '0985eed6-1e8b-477f-b222-2f308ce4d6a4'
|
247
|
-
Content-Type:
|
248
|
-
- application/x-amz-json-1.0
|
249
|
-
X-Amz-Crc32:
|
250
|
-
- '2745614147'
|
251
|
-
Content-Length:
|
252
|
-
- '2'
|
253
|
-
Server:
|
254
|
-
- Jetty(11.0.17)
|
255
|
-
body:
|
256
|
-
encoding: UTF-8
|
257
|
-
string: "{}"
|
258
|
-
recorded_at: Tue, 14 May 2024 14:46:20 GMT
|
259
|
-
- request:
|
260
|
-
method: post
|
261
|
-
uri: http://localhost:8000/
|
262
|
-
body:
|
263
|
-
encoding: UTF-8
|
264
|
-
string: '{"TableName":"fleteo-v2-cars-users","IndexName":"fleteo-v2-cars-users-index","KeyConditionExpression":"#user_id
|
265
|
-
= :user_id","ExpressionAttributeNames":{"#user_id":"user_id"},"ExpressionAttributeValues":{":user_id":{"S":"hguzman10@gmail.com"}}}'
|
266
|
-
headers:
|
267
|
-
Accept-Encoding:
|
268
|
-
- ''
|
269
|
-
Content-Type:
|
270
|
-
- application/x-amz-json-1.0
|
271
|
-
X-Amz-Target:
|
272
|
-
- DynamoDB_20120810.Query
|
273
|
-
User-Agent:
|
274
|
-
- 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
|
275
|
-
md/3.2.3 cfg/retry-mode#legacy
|
276
|
-
Host:
|
277
|
-
- localhost:8000
|
278
|
-
X-Amz-Date:
|
279
|
-
- 20240514T144620Z
|
280
|
-
X-Amz-Content-Sha256:
|
281
|
-
- 0175d24f36fe98a611d5abdc67ddc83bb5d7192f7b6330d0014ace2323300f43
|
282
|
-
Authorization:
|
283
|
-
- AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
|
284
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
|
285
|
-
Signature=37002d3bf5b8fefae8dd5333571d23b019cb94b2f4e2dc447a0724e126016367
|
286
|
-
Content-Length:
|
287
|
-
- '243'
|
288
|
-
Accept:
|
289
|
-
- "*/*"
|
290
|
-
response:
|
291
|
-
status:
|
292
|
-
code: 200
|
293
|
-
message: OK
|
294
|
-
headers:
|
295
|
-
Date:
|
296
|
-
- Tue, 14 May 2024 14:46:20 GMT
|
297
|
-
X-Amzn-Requestid:
|
298
|
-
- 84268b0a-f0a9-41d6-bb0c-8fad9b03f224
|
299
|
-
Content-Type:
|
300
|
-
- application/x-amz-json-1.0
|
301
|
-
X-Amz-Crc32:
|
302
|
-
- '1919856377'
|
303
|
-
Content-Length:
|
304
|
-
- '102'
|
305
|
-
Server:
|
306
|
-
- Jetty(11.0.17)
|
307
|
-
body:
|
308
|
-
encoding: UTF-8
|
309
|
-
string: '{"Items":[{"user_id":{"S":"hguzman10@gmail.com"},"car_id":{"S":"UVX455"}}],"Count":1,"ScannedCount":1}'
|
310
|
-
recorded_at: Tue, 14 May 2024 14:46:20 GMT
|
311
|
-
- request:
|
312
|
-
method: post
|
313
|
-
uri: http://localhost:8000/
|
314
|
-
body:
|
315
|
-
encoding: UTF-8
|
316
|
-
string: '{"TableName":"fleteo-v2-cars","Key":{"id":{"S":"UVX455"}}}'
|
317
|
-
headers:
|
318
|
-
Accept-Encoding:
|
319
|
-
- ''
|
320
|
-
Content-Type:
|
321
|
-
- application/x-amz-json-1.0
|
322
|
-
X-Amz-Target:
|
323
|
-
- DynamoDB_20120810.GetItem
|
324
|
-
User-Agent:
|
325
|
-
- 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
|
326
|
-
md/3.2.3 cfg/retry-mode#legacy
|
327
|
-
Host:
|
328
|
-
- localhost:8000
|
329
|
-
X-Amz-Date:
|
330
|
-
- 20240514T144620Z
|
331
|
-
X-Amz-Content-Sha256:
|
332
|
-
- 3f40080fdb7ac1732232c14b86645a9ffbd3f94cf8ecda6b3c584d105288bb8d
|
333
|
-
Authorization:
|
334
|
-
- AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
|
335
|
-
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
|
336
|
-
Signature=a7aa82df282063303cea5d1f31b73ba19956d24c980a68b21e8e421d3d26e5b9
|
337
|
-
Content-Length:
|
338
|
-
- '58'
|
339
|
-
Accept:
|
340
|
-
- "*/*"
|
341
|
-
response:
|
342
|
-
status:
|
343
|
-
code: 200
|
344
|
-
message: OK
|
345
|
-
headers:
|
346
|
-
Date:
|
347
|
-
- Tue, 14 May 2024 14:46:20 GMT
|
348
|
-
X-Amzn-Requestid:
|
349
|
-
- 68b8bc16-fa54-4518-9038-0a755be7960d
|
350
|
-
Content-Type:
|
351
|
-
- application/x-amz-json-1.0
|
352
|
-
X-Amz-Crc32:
|
353
|
-
- '590923779'
|
354
|
-
Content-Length:
|
355
|
-
- '149'
|
356
|
-
Server:
|
357
|
-
- Jetty(11.0.17)
|
358
|
-
body:
|
359
|
-
encoding: UTF-8
|
360
|
-
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"}}}'
|
361
|
-
recorded_at: Tue, 14 May 2024 14:46:20 GMT
|
362
|
-
recorded_with: VCR 6.2.0
|