dynamini 1.1.0 → 1.1.2
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.
- checksums.yaml +4 -4
 - data/lib/dynamini/base.rb +2 -3
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 2f357d5b69bd45bffd280979e81e4d687c9f2f63
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 4aa28b9941042a7a4793fd5664ae326a0bf7d441
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 0e30e7916315fab9860d7916482e0a607aef178757798223c09e080d5716d3ff1efcdbf6b735e0eabdac32511e06e842993b795e8878f77c9b788ec1933978d5
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: f1f45b799d78648893ab84e055172c1de3c507904b0c91f88aced9e06591cb35c7c86364f36254a95b097b862fc424661a53aecfd59cdf67c49dbb4825d1f1d5
         
     | 
    
        data/lib/dynamini/base.rb
    CHANGED
    
    | 
         @@ -46,7 +46,7 @@ module Dynamini 
     | 
|
| 
       46 
46 
     | 
    
         
             
                  end
         
     | 
| 
       47 
47 
     | 
    
         | 
| 
       48 
48 
     | 
    
         
             
                  def find(key)
         
     | 
| 
       49 
     | 
    
         
            -
                    response = client.get_item(table_name: table_name, key: {hash_key => key})
         
     | 
| 
      
 49 
     | 
    
         
            +
                    response = client.get_item(table_name: table_name, key: {hash_key => key.to_s})
         
     | 
| 
       50 
50 
     | 
    
         
             
                    raise 'Item not found.' unless response.item
         
     | 
| 
       51 
51 
     | 
    
         
             
                    self.new(response.item.symbolize_keys, false)
         
     | 
| 
       52 
52 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -64,7 +64,7 @@ module Dynamini 
     | 
|
| 
       64 
64 
     | 
    
         
             
                    return [] if ids.length < 1
         
     | 
| 
       65 
65 
     | 
    
         
             
                    objects = []
         
     | 
| 
       66 
66 
     | 
    
         
             
                    raise StandardError, 'Batch find is limited to 100 items' if ids.length > 100
         
     | 
| 
       67 
     | 
    
         
            -
                    key_structure = ids.map { |i| {hash_key => i} }
         
     | 
| 
      
 67 
     | 
    
         
            +
                    key_structure = ids.map { |i| {hash_key => i.to_s} }
         
     | 
| 
       68 
68 
     | 
    
         
             
                    response = self.dynamo_batch_get(key_structure)
         
     | 
| 
       69 
69 
     | 
    
         
             
                    response.responses[table_name].each do |item|
         
     | 
| 
       70 
70 
     | 
    
         
             
                      objects << self.new(item.symbolize_keys, false)
         
     | 
| 
         @@ -232,7 +232,6 @@ module Dynamini 
     | 
|
| 
       232 
232 
     | 
    
         
             
                end
         
     | 
| 
       233 
233 
     | 
    
         | 
| 
       234 
234 
     | 
    
         
             
                def write_attribute(attribute, new_value)
         
     | 
| 
       235 
     | 
    
         
            -
                  raise StandardError, 'Cannot edit hash key, create a new object instead.' if attribute == self.class.hash_key
         
     | 
| 
       236 
235 
     | 
    
         
             
                  old_value = @attributes[attribute]
         
     | 
| 
       237 
236 
     | 
    
         
             
                  @attributes[attribute] = new_value
         
     | 
| 
       238 
237 
     | 
    
         
             
                  record_change(attribute, new_value, old_value)
         
     |