tiny_dyno 0.1.10 → 0.1.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a5a334e766b682c0dd8efe2eb7ac34fc4cf85ce
4
- data.tar.gz: 1e7428905fab9f8cf20ab1d30ce0dc3446badc47
3
+ metadata.gz: dad49629c87d23c41034877a01393def956c568e
4
+ data.tar.gz: 0e6ceca28ce34d7c53a8ed3ad4e9c75b531d8036
5
5
  SHA512:
6
- metadata.gz: 627ebefe50230f6274294750207d30b8e2968189a7d02d992c506f3fb63af5511297c7cae042447201ca73fc073b3bb3405d7175ccb2395b3c5d10a249bb5610
7
- data.tar.gz: 8fea34f5b1c9985b544f7c789b8aefb3f7745a4c5b3650a4c90ac2f897c72436fb4894887162d1129b4dc4432cef59c6e164afb568716e8883422c403a6abfe4
6
+ metadata.gz: 2b0ceaaf98b68e1f216f93099aa5ee8749145a561b7e729bc92be64668894cc6fee883f6cfd7d28ca232941e0059e28f583cec51dc1cbda3d61cadbb37694527
7
+ data.tar.gz: 47f32b1f3d66bc0128b505a5a64c6f971987a16490489bd9abef230e9689e6d4d1c0d6d3b796c8ff474c0f9c93c010197b0b2dfa4f73abbe3bb17f93d14d71b1
data/CHANGES.md CHANGED
@@ -1,4 +1,11 @@
1
+ 0.1.11 (2015-07-04)
2
+ -------------------
3
+
4
+ * Fix - retract update_item support
5
+ Instead add a modified put operation, which will overwrite an entire record, when saving an update to an already existing object
6
+
1
7
  0.1.10 (2015-07-04)
8
+ -------------------
2
9
 
3
10
  * New - (basic) update_item support, for atomic PUT and DELETE actions, no support for ADD action yet
4
11
 
@@ -12,7 +12,7 @@ module TinyDyno
12
12
  return false
13
13
  end
14
14
  else
15
- if request_update_item(options)
15
+ if request_replace_item(options)
16
16
  changes_applied
17
17
  return true
18
18
  else
@@ -28,9 +28,9 @@ module TinyDyno
28
28
  return(TinyDyno::Adapter.put_item(put_item_request: request))
29
29
  end
30
30
 
31
- def request_update_item(options)
32
- request = build_update_item_request
33
- return(TinyDyno::Adapter.update_item(update_item_request: request))
31
+ def request_replace_item(options)
32
+ request = build_put_item_request
33
+ return(TinyDyno::Adapter.put_item(put_item_request: request))
34
34
  end
35
35
 
36
36
  def build_put_item_request
@@ -40,13 +40,13 @@ module TinyDyno
40
40
  }
41
41
  end
42
42
 
43
- def build_update_item_request
44
- {
45
- key: hash_key_as_selector,
46
- table_name: self.class.table_name,
47
- attribute_updates: build_attribute_updates
48
- }
49
- end
43
+ # def build_update_item_request
44
+ # {
45
+ # key: hash_key_as_selector,
46
+ # table_name: self.class.table_name,
47
+ # attribute_updates: build_attribute_updates
48
+ # }
49
+ # end
50
50
 
51
51
  def build_item_request_entries
52
52
  item_entries = {}
@@ -59,34 +59,34 @@ module TinyDyno
59
59
  # value: "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
60
60
  # action: "ADD", # accepts ADD, PUT, DELETE
61
61
  # },
62
- def build_attribute_updates
63
- change_record = []
64
- changes.keys.each do |change_key|
65
- if self.class.attribute_names.include?(change_key)
66
- change_record << {:"#{ change_key}" => changes[change_key]}
67
- end
68
- end
69
- # keep this simple for now
70
- # I don't see (yet) how to map the possible operations on dynamodb items
71
- # into activerecord compatible schemas
72
- # extend as use cases arise
73
- # specification by example ...
74
- attribute_updates = {}
75
- change_record.each do |change|
76
- change_key = change.keys.first
77
- if change[change_key][1].nil?
78
- attribute_updates[change_key] = {
79
- action: 'DELETE'
80
- }
81
- else
82
- attribute_updates[change_key] = {
83
- value: change[change_key][1],
84
- action: 'PUT'
85
- }
86
- end
87
- end
88
- attribute_updates
89
- end
62
+ # def build_attribute_updates
63
+ # change_record = []
64
+ # changes.keys.each do |change_key|
65
+ # if self.class.attribute_names.include?(change_key)
66
+ # change_record << {:"#{ change_key}" => changes[change_key]}
67
+ # end
68
+ # end
69
+ # # keep this simple for now
70
+ # # I don't see (yet) how to map the possible operations on dynamodb items
71
+ # # into activerecord compatible schemas
72
+ # # extend as use cases arise
73
+ # # specification by example ...
74
+ # attribute_updates = {}
75
+ # change_record.each do |change|
76
+ # change_key = change.keys.first
77
+ # if change[change_key][1].nil?
78
+ # attribute_updates[change_key] = {
79
+ # action: 'DELETE'
80
+ # }
81
+ # else
82
+ # attribute_updates[change_key] = {
83
+ # value: change[change_key][1],
84
+ # action: 'PUT'
85
+ # }
86
+ # end
87
+ # end
88
+ # attribute_updates
89
+ # end
90
90
 
91
91
  module ClassMethods
92
92
 
@@ -1,3 +1,3 @@
1
1
  module TinyDyno
2
- VERSION = '0.1.10'
2
+ VERSION = '0.1.11'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_dyno
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Gerschner