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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99542bc5ae653030ec6bcfe12df6285effd013b0a95c7e7103d004d5308bd7c0
4
- data.tar.gz: adf98f1f8d227c14a158801bf792e89df239751345cd044202b5a0b3cd744026
3
+ metadata.gz: ba0cab197e4c82a702171a78a2af524612fef3d51d4f42c0879d7b1940779efe
4
+ data.tar.gz: a17d46ca50b8724a7f2d4593143f4362ca112845aeb7d9e28b4774f4aa768264
5
5
  SHA512:
6
- metadata.gz: c74e20644faa6ed65474b788e63f097dca6d6939ffee964b5d431a28eb427adee65fd73c6c89cfa17c314a9803fc1cec743f43ae6d8e9b608e0702d8ea447733
7
- data.tar.gz: 879bc33d1d59592ab18a97ee3491e14cdaf98413850e325b8e8589c773b356dd2623a316783a0de8be272d70f3dbe0e5a9604de6fdf49f5946684eb63a0b5f7a
6
+ metadata.gz: c205ab08ade2838e917c4fa083d059f08c26910c742c9039e9b6c4a7c86430149226bb22e6481d88bbd7cd2eab9eef8bff4021ef4b40b00d5a1d7ec0d2b0509d
7
+ data.tar.gz: 3892ca684ddc538cf332420a9ec438ee33004084cef8192c6e4e1cca9c8a96a4c6823aef783cfd69de02f529e9c70605bcedc964170de1e061786c370fd0172e
@@ -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
 
@@ -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: {partition_key => id}
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 = "category:string"
36
- # i.sort_key = "created_at:string" # optional
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 = "category:string"
46
- # i.sort_key = "created_at:string" # optional
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
@@ -1,3 +1,3 @@
1
1
  module Dynomite
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
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.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-01-25 00:00:00.000000000 Z
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
- rubyforge_project:
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