dynomite 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/dynomite/item.rb +9 -1
- data/lib/dynomite/migration/dsl.rb +4 -4
- data/lib/dynomite/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba0cab197e4c82a702171a78a2af524612fef3d51d4f42c0879d7b1940779efe
|
4
|
+
data.tar.gz: a17d46ca50b8724a7f2d4593143f4362ca112845aeb7d9e28b4774f4aa768264
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c205ab08ade2838e917c4fa083d059f08c26910c742c9039e9b6c4a7c86430149226bb22e6481d88bbd7cd2eab9eef8bff4021ef4b40b00d5a1d7ec0d2b0509d
|
7
|
+
data.tar.gz: 3892ca684ddc538cf332420a9ec438ee33004084cef8192c6e4e1cca9c8a96a4c6823aef783cfd69de02f529e9c70605bcedc964170de1e061786c370fd0172e
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [1.2.3]
|
7
|
+
- #11 fix comments in dsl.rb
|
8
|
+
- #13 update find method to support composite key
|
9
|
+
|
6
10
|
## [1.2.2]
|
7
11
|
- update Jets.root usage
|
8
12
|
|
data/lib/dynomite/item.rb
CHANGED
@@ -236,9 +236,17 @@ module Dynomite
|
|
236
236
|
end
|
237
237
|
|
238
238
|
def self.find(id)
|
239
|
+
params =
|
240
|
+
case id
|
241
|
+
when String
|
242
|
+
{ partition_key => id }
|
243
|
+
when Hash
|
244
|
+
id
|
245
|
+
end
|
246
|
+
|
239
247
|
resp = db.get_item(
|
240
248
|
table_name: table_name,
|
241
|
-
key:
|
249
|
+
key: params
|
242
250
|
)
|
243
251
|
attributes = resp.item # unwraps the item's attributes
|
244
252
|
self.new(attributes) if attributes
|
@@ -32,8 +32,8 @@ class Dynomite::Migration
|
|
32
32
|
end
|
33
33
|
|
34
34
|
# t.gsi(:create) do |i|
|
35
|
-
# i.partition_key
|
36
|
-
# i.sort_key
|
35
|
+
# i.partition_key "category:string"
|
36
|
+
# i.sort_key "created_at:string" # optional
|
37
37
|
# end
|
38
38
|
def gsi(action=:create, index_name=nil, &block)
|
39
39
|
gsi_index = GlobalSecondaryIndex.new(action, index_name, &block)
|
@@ -42,8 +42,8 @@ class Dynomite::Migration
|
|
42
42
|
alias_method :global_secondary_index, :gsi
|
43
43
|
|
44
44
|
# t.lsi(:create) do |i|
|
45
|
-
# i.partition_key
|
46
|
-
# i.sort_key
|
45
|
+
# i.partition_key "category:string"
|
46
|
+
# i.sort_key "created_at:string" # optional
|
47
47
|
# end
|
48
48
|
def lsi(action=:create, index_name=nil, &block)
|
49
49
|
# dont need action create but have it to keep the lsi and gsi method consistent
|
data/lib/dynomite/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynomite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -135,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
|
-
|
139
|
-
rubygems_version: 2.7.6
|
138
|
+
rubygems_version: 3.0.6
|
140
139
|
signing_key:
|
141
140
|
specification_version: 4
|
142
141
|
summary: ActiveRecord-ish Dynamodb Model
|