mince_dynamo_db 1.2.0 → 1.3.0

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.
@@ -135,7 +135,7 @@ module MinceDynamoDb # :nodoc:
135
135
  # @return [Array] an array of all records matching the given hash for the collection
136
136
  def get_by_params(collection_name, hash)
137
137
  hash = HashWithIndifferentAccess.new(hash)
138
- array_to_hash(items(collection_name).where(hash))
138
+ array_to_hash(items(collection_name).where(hash).select)
139
139
  end
140
140
 
141
141
  # Gets all records for a collection
@@ -143,7 +143,7 @@ module MinceDynamoDb # :nodoc:
143
143
  # @param [String] collection_name the name of the collection
144
144
  # @return [Array] all records for the given collection name
145
145
  def find_all(collection_name)
146
- array_to_hash(items(collection_name))
146
+ array_to_hash(items(collection_name).select)
147
147
  end
148
148
 
149
149
  # Gets a record matching a key and value
@@ -176,7 +176,7 @@ module MinceDynamoDb # :nodoc:
176
176
  # @param [String] array_key the field to push an array from
177
177
  # @param [*] value_to_remove the value to remove from the array
178
178
  def remove_from_array(collection_name, identifying_key, identifying_value, array_key, value_to_remove)
179
- item = items(collection_name).where(identifying_key.to_s => identifying_value).first
179
+ item = items(collection_name).where(identifying_key.to_s => identifying_value).select.first
180
180
  item.attributes.delete(array_key => [value_to_remove])
181
181
  end
182
182
 
@@ -187,7 +187,7 @@ module MinceDynamoDb # :nodoc:
187
187
  # @param [Array] values an array of values that the record could contain
188
188
  # @return [Array] all records that contain any of the values given
189
189
  def containing_any(collection_name, key, values)
190
- array_to_hash items(collection_name).where(key.to_sym).in(values)
190
+ array_to_hash items(collection_name).where(key.to_sym).in(values).select
191
191
  end
192
192
 
193
193
  # Returns all records where the given key contains the given value
@@ -197,12 +197,12 @@ module MinceDynamoDb # :nodoc:
197
197
  # @param [*] value the value to find a record by
198
198
  # @return [Array] all records where the key contains the given value
199
199
  def array_contains(collection_name, key, value)
200
- array_to_hash items(collection_name).where(key.to_sym).contains(value)
200
+ array_to_hash items(collection_name).where(key.to_sym).contains(value).select
201
201
  end
202
202
 
203
203
  # Deletes a record that matches the given criteria from the data store.
204
204
  def delete_by_params(collection_name, params)
205
- item = items(collection_name).where(params).first
205
+ item = items(collection_name).where(params).select.first
206
206
  item.delete
207
207
  end
208
208
 
@@ -1,3 +1,3 @@
1
1
  module MinceDynamoDb
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mince_dynamo_db
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-08 00:00:00.000000000 Z
12
+ date: 2012-09-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk