dynamodb_record 0.3.0 → 0.3.2
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/lib/dynamodb_record/associations.rb +30 -31
- data/lib/dynamodb_record/finders.rb +0 -1
- data/lib/dynamodb_record/has_and_belongs_to_many_collection.rb +9 -0
- data/lib/dynamodb_record/query.rb +1 -0
- data/lib/dynamodb_record/version.rb +1 -1
- data/spec/dynamodb_record/association_spec.rb +7 -0
- data/spec/dynamodb_record/config_spec.rb +28 -0
- data/spec/dynamodb_record/document_spec.rb +4 -4
- data/spec/dynamodb_record/finders_spec.rb +7 -7
- data/spec/dynamodb_record/persistence_spec.rb +12 -12
- data/spec/dynamodb_record/query_spec.rb +2 -2
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_belongs_to/get_object.yml +18 -18
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/add_list.yml +362 -0
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/create_item.yml +28 -27
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/get_collection.yml +19 -18
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/has_and_belongs_to_many.yml +31 -31
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/has_and_belongs_to_many_create.yml +91 -39
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/has_many_through.yml +30 -27
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Document/initializes_from_database.yml +11 -11
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Fields/_find/finds_record.yml +12 -12
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Fields/_find/when_record_doesn_t_exists/returns_empty_object.yml +9 -9
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Persistence/_destroy/when_no_range_key/destroys_record.yml +30 -30
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Persistence/_destroy/when_there_is_range_key/destroys_record.yml +9 -111
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Persistence/does_not_overwrite_existing_record.yml +20 -20
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Persistence/saves_record.yml +9 -9
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Persistence/updates_record.yml +31 -31
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Query/_all/find_all_records.yml +12 -12
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Query/querying/_where/returns_records_by_limit.yml +12 -12
- data/spec/fixtures/vcr_cassettes/DynamodbRecord_Query/querying/_where/returns_records_where_user_balance_0.yml +12 -12
- data/spec/spec_helper.rb +7 -6
- metadata +4 -2
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: http://localhost:8000/
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"TableName":"users"}'
|
8
|
+
string: '{"TableName":"fleteo-v2-users"}'
|
9
9
|
headers:
|
10
10
|
Accept-Encoding:
|
11
11
|
- ''
|
@@ -19,15 +19,15 @@ http_interactions:
|
|
19
19
|
Host:
|
20
20
|
- localhost:8000
|
21
21
|
X-Amz-Date:
|
22
|
-
-
|
22
|
+
- 20240514T152305Z
|
23
23
|
X-Amz-Content-Sha256:
|
24
|
-
-
|
24
|
+
- 9dec864d69838ba5d22e6418808d299b1e52448b13f38b3347adcc4cd4891407
|
25
25
|
Authorization:
|
26
|
-
- AWS4-HMAC-SHA256 Credential=key/
|
26
|
+
- AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
|
27
27
|
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
|
28
|
-
Signature=
|
28
|
+
Signature=749f5b5fb627b4138d9a86e0b77f36a5339897e9341909dc02b810373757672d
|
29
29
|
Content-Length:
|
30
|
-
- '
|
30
|
+
- '31'
|
31
31
|
Accept:
|
32
32
|
- "*/*"
|
33
33
|
response:
|
@@ -36,19 +36,19 @@ http_interactions:
|
|
36
36
|
message: OK
|
37
37
|
headers:
|
38
38
|
Date:
|
39
|
-
-
|
39
|
+
- Tue, 14 May 2024 15:23:05 GMT
|
40
40
|
X-Amzn-Requestid:
|
41
|
-
-
|
41
|
+
- 5b5f67db-aa09-41cd-a1df-ad59eb8bd4ab
|
42
42
|
Content-Type:
|
43
43
|
- application/x-amz-json-1.0
|
44
44
|
X-Amz-Crc32:
|
45
|
-
- '
|
45
|
+
- '2883154713'
|
46
46
|
Content-Length:
|
47
|
-
- '
|
47
|
+
- '222'
|
48
48
|
Server:
|
49
49
|
- Jetty(11.0.17)
|
50
50
|
body:
|
51
51
|
encoding: UTF-8
|
52
|
-
string: '{"Items":[{"
|
53
|
-
recorded_at:
|
52
|
+
string: '{"Items":[{"id":{"S":"hguzman20@gmail.com"}},{"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"}}],"Count":2,"ScannedCount":2}'
|
53
|
+
recorded_at: Tue, 14 May 2024 15:23:05 GMT
|
54
54
|
recorded_with: VCR 6.2.0
|
data/spec/fixtures/vcr_cassettes/DynamodbRecord_Query/querying/_where/returns_records_by_limit.yml
CHANGED
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: http://localhost:8000/
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"TableName":"users","Limit":1,"ExpressionAttributeNames":{"#balance":"balance"},"ExpressionAttributeValues":{":balance":{"N":"0"}},"FilterExpression":"#balance
|
8
|
+
string: '{"TableName":"fleteo-v2-users","Limit":1,"ExpressionAttributeNames":{"#balance":"balance"},"ExpressionAttributeValues":{":balance":{"N":"0"}},"FilterExpression":"#balance
|
9
9
|
= :balance"}'
|
10
10
|
headers:
|
11
11
|
Accept-Encoding:
|
@@ -20,15 +20,15 @@ http_interactions:
|
|
20
20
|
Host:
|
21
21
|
- localhost:8000
|
22
22
|
X-Amz-Date:
|
23
|
-
-
|
23
|
+
- 20240514T153259Z
|
24
24
|
X-Amz-Content-Sha256:
|
25
|
-
-
|
25
|
+
- 4a817ea4a9315bf50e176703f307eb0ecd51182faecce44db7fbc3456b7b810b
|
26
26
|
Authorization:
|
27
|
-
- AWS4-HMAC-SHA256 Credential=
|
27
|
+
- AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
|
28
28
|
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
|
29
|
-
Signature=
|
29
|
+
Signature=3b0bee5c42907ed6f8c46535d5979012b376c30597ae870b6a29a63713a9ddf5
|
30
30
|
Content-Length:
|
31
|
-
- '
|
31
|
+
- '183'
|
32
32
|
Accept:
|
33
33
|
- "*/*"
|
34
34
|
response:
|
@@ -37,19 +37,19 @@ http_interactions:
|
|
37
37
|
message: OK
|
38
38
|
headers:
|
39
39
|
Date:
|
40
|
-
-
|
40
|
+
- Tue, 14 May 2024 15:32:59 GMT
|
41
41
|
X-Amzn-Requestid:
|
42
|
-
-
|
42
|
+
- 9df141bf-61b8-4255-bf5c-3f567a0adbe2
|
43
43
|
Content-Type:
|
44
44
|
- application/x-amz-json-1.0
|
45
45
|
X-Amz-Crc32:
|
46
|
-
- '
|
46
|
+
- '599331903'
|
47
47
|
Content-Length:
|
48
|
-
- '
|
48
|
+
- '147'
|
49
49
|
Server:
|
50
50
|
- Jetty(11.0.17)
|
51
51
|
body:
|
52
52
|
encoding: UTF-8
|
53
|
-
string: '{"Items":[{"balance":{"N":"0"},"
|
54
|
-
recorded_at:
|
53
|
+
string: '{"Items":[{"balance":{"N":"0"},"id":{"S":"hguzman20@gmail.com"}}],"Count":1,"ScannedCount":1,"LastEvaluatedKey":{"id":{"S":"hguzman20@gmail.com"}}}'
|
54
|
+
recorded_at: Tue, 14 May 2024 15:32:59 GMT
|
55
55
|
recorded_with: VCR 6.2.0
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: http://localhost:8000/
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"TableName":"users","Limit":1,"ExpressionAttributeNames":{"#balance":"balance"},"ExpressionAttributeValues":{":balance":{"N":"0"}},"FilterExpression":"#balance
|
8
|
+
string: '{"TableName":"fleteo-v2-users","Limit":1,"ExpressionAttributeNames":{"#balance":"balance"},"ExpressionAttributeValues":{":balance":{"N":"0"}},"FilterExpression":"#balance
|
9
9
|
= :balance"}'
|
10
10
|
headers:
|
11
11
|
Accept-Encoding:
|
@@ -20,15 +20,15 @@ http_interactions:
|
|
20
20
|
Host:
|
21
21
|
- localhost:8000
|
22
22
|
X-Amz-Date:
|
23
|
-
-
|
23
|
+
- 20240514T153259Z
|
24
24
|
X-Amz-Content-Sha256:
|
25
|
-
-
|
25
|
+
- 4a817ea4a9315bf50e176703f307eb0ecd51182faecce44db7fbc3456b7b810b
|
26
26
|
Authorization:
|
27
|
-
- AWS4-HMAC-SHA256 Credential=
|
27
|
+
- AWS4-HMAC-SHA256 Credential=key/20240514/us-east-1/dynamodb/aws4_request,
|
28
28
|
SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date;x-amz-target,
|
29
|
-
Signature=
|
29
|
+
Signature=3b0bee5c42907ed6f8c46535d5979012b376c30597ae870b6a29a63713a9ddf5
|
30
30
|
Content-Length:
|
31
|
-
- '
|
31
|
+
- '183'
|
32
32
|
Accept:
|
33
33
|
- "*/*"
|
34
34
|
response:
|
@@ -37,19 +37,19 @@ http_interactions:
|
|
37
37
|
message: OK
|
38
38
|
headers:
|
39
39
|
Date:
|
40
|
-
-
|
40
|
+
- Tue, 14 May 2024 15:32:59 GMT
|
41
41
|
X-Amzn-Requestid:
|
42
|
-
-
|
42
|
+
- 59b0840f-6a56-49bd-953f-d22946459e02
|
43
43
|
Content-Type:
|
44
44
|
- application/x-amz-json-1.0
|
45
45
|
X-Amz-Crc32:
|
46
|
-
- '
|
46
|
+
- '599331903'
|
47
47
|
Content-Length:
|
48
|
-
- '
|
48
|
+
- '147'
|
49
49
|
Server:
|
50
50
|
- Jetty(11.0.17)
|
51
51
|
body:
|
52
52
|
encoding: UTF-8
|
53
|
-
string: '{"Items":[{"balance":{"N":"0"},"
|
54
|
-
recorded_at:
|
53
|
+
string: '{"Items":[{"balance":{"N":"0"},"id":{"S":"hguzman20@gmail.com"}}],"Count":1,"ScannedCount":1,"LastEvaluatedKey":{"id":{"S":"hguzman20@gmail.com"}}}'
|
54
|
+
recorded_at: Tue, 14 May 2024 15:32:59 GMT
|
55
55
|
recorded_with: VCR 6.2.0
|
data/spec/spec_helper.rb
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
require 'dynamodb_record'
|
4
4
|
|
5
|
+
DynamodbRecord.configure do |config|
|
6
|
+
config.namespace = 'fleteo-v2'
|
7
|
+
config.endpoint = 'http://localhost:8000'
|
8
|
+
config.access_key_id = ENV['DYNAMODB_KEY'] || 'key'
|
9
|
+
config.secret_access_key = ENV['DYNAMODB_SECRET'] || 'secret'
|
10
|
+
end
|
11
|
+
|
5
12
|
MODELS = File.join(File.dirname(__FILE__), 'app/models')
|
6
13
|
Dir[File.join(MODELS, '*.rb')].each { |file| require file }
|
7
14
|
# Dir[File.join(MODELS, '*.rb')].sort.each { |file| require file }
|
@@ -16,9 +23,3 @@ VCR.configure do |c|
|
|
16
23
|
# c.default_cassette_options = { match_requests_on: %i[method uri body] }
|
17
24
|
end
|
18
25
|
|
19
|
-
DynamodbRecord.configure do |config|
|
20
|
-
config.namespace = nil
|
21
|
-
config.endpoint = 'http://localhost:8000'
|
22
|
-
config.access_key_id = ENV['DYNAMODB_KEY'] || 'key'
|
23
|
-
config.secret_access_key = ENV['DYNAMODB_SECRET'] || 'secret'
|
24
|
-
end
|
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.
|
4
|
+
version: 0.3.2
|
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-
|
12
|
+
date: 2024-05-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -195,12 +195,14 @@ files:
|
|
195
195
|
- spec/app/models/service.rb
|
196
196
|
- spec/app/models/user.rb
|
197
197
|
- spec/dynamodb_record/association_spec.rb
|
198
|
+
- spec/dynamodb_record/config_spec.rb
|
198
199
|
- spec/dynamodb_record/document_spec.rb
|
199
200
|
- spec/dynamodb_record/fields_spec.rb
|
200
201
|
- spec/dynamodb_record/finders_spec.rb
|
201
202
|
- spec/dynamodb_record/persistence_spec.rb
|
202
203
|
- spec/dynamodb_record/query_spec.rb
|
203
204
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_belongs_to/get_object.yml
|
205
|
+
- spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/add_list.yml
|
204
206
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/create_item.yml
|
205
207
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/_has_many/get_collection.yml
|
206
208
|
- spec/fixtures/vcr_cassettes/DynamodbRecord_Associations/has_and_belongs_to_many.yml
|