lib/dynamodb_manager.rb in dynamodb_geo-0.1.5 vs lib/dynamodb_manager.rb in dynamodb_geo-0.1.6

- old
+ new

@@ -54,11 +54,11 @@ zip: store.zip, area_code: store.area_code, phone: store.phone, name: store.name, } - put_point(hash, json) + put_point(hash, json, store.uuid) end def get_stores(lat, long) geohash = Geohash.encode(lat, long, @local_area_size) hash = geohash[0..(@hash_key_length - 1)] @@ -116,11 +116,11 @@ }, key_condition_expression: "#{@hash_key} = :hash", }) end - def put_point(hash, json) - uuid = SecureRandom.uuid + def put_point(hash, json, uuid = nil) + uuid ||= SecureRandom.uuid @client.put_item({ table_name: @table_name, item: { @hash_key => hash[0..(@hash_key_length - 1)],