dynamini 2.9.4 → 2.9.5

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
  SHA1:
3
- metadata.gz: ebd0e269336c9f95ef216c388e639937d4521d48
4
- data.tar.gz: 0e88fb606a0c2a40f12c9895b578e3de70e51ada
3
+ metadata.gz: 9f7c910987e834399c78a7c26cf2524d00eb6729
4
+ data.tar.gz: 74298b30b3f7994a64ee6d54b0d6d15709eaabd0
5
5
  SHA512:
6
- metadata.gz: b7d3fb89285521304043e7ccbd302d16621dfaf0202117cba4d79df46cf5c3335bb83e0c49740e11dd268a95d679d804f9b0e2455c19445d282658f2b33b111f
7
- data.tar.gz: 0151358e63ad145f0c672355165c7c272992743960c9786b098bda3d9f64415a3aae9a568229dd2aee42a12a2f0fd00117c80872b2b05b029c12d059a86edcc8
6
+ metadata.gz: 2aa48e095d7f04867863d9e33571f90e57e8bde41daa5c6c36ddfd6b9428c814187fbb39111b7eca4cfaa0f8c5cc591aaecdd425d6100e4a043a5ee601bda1a6
7
+ data.tar.gz: 76fcae444b9633607b5abb142afd5bf2fd2182edc42390a5be61b6fb1adb8d8bc10519c01da1c8b84148563bc10fd8da74bab70786981f8c19571398a51e42f8
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dynamini (2.9.3)
4
+ dynamini (2.9.5)
5
5
  activemodel (>= 3, < 5.0)
6
6
  aws-sdk (~> 2)
7
7
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'dynamini'
3
- s.version = '2.9.4'
3
+ s.version = '2.9.5'
4
4
  s.summary = 'DynamoDB interface'
5
5
  s.description = 'Lightweight DynamoDB interface gem designed as
6
6
  a drop-in replacement for ActiveRecord.
@@ -103,7 +103,7 @@ module Dynamini
103
103
 
104
104
  def index_of_start_key(args, records)
105
105
  if args[:exclusive_start_key]
106
- sec_index = secondary_index[args[:secondary_index_name]]
106
+ sec_index = secondary_index && secondary_index[args[:secondary_index_name]]
107
107
  start_index = records.index do |r|
108
108
  if sec_index
109
109
  r[get_secondary_hash_key(sec_index)] == args[:exclusive_start_key].values[0]
@@ -111,7 +111,7 @@ module Dynamini
111
111
  r[hash_key_attr] == args[:exclusive_start_key].values[0]
112
112
  end
113
113
  end
114
- start_index || -1
114
+ start_index || 0
115
115
  else
116
116
  0
117
117
  end
@@ -123,7 +123,7 @@ module Dynamini
123
123
  end
124
124
 
125
125
  def get_last_evaluated_key(secondary_index_name, items, records)
126
- if items.last != records.last
126
+ if records.length > 0 && items.last != records.last
127
127
  index = secondary_index[secondary_index_name]
128
128
  if index
129
129
  { get_secondary_hash_key(index).to_s => items.last[get_secondary_hash_key(index)] }
@@ -218,6 +218,12 @@ describe Dynamini::BatchOperations do
218
218
  end
219
219
  end
220
220
  end
221
+
222
+ context 'with a model with no secondary indices but with a start key' do
223
+ it 'behaves' do
224
+ expect{ Dynamini::Base.scan(start_key: '123') }.to_not raise_error
225
+ end
226
+ end
221
227
  end
222
228
  end
223
229
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamini
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.4
4
+ version: 2.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Ward
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2017-09-13 00:00:00.000000000 Z
18
+ date: 2017-09-14 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activemodel