dynarex 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dynarex.rb +5 -1
- metadata +1 -1
data/lib/dynarex.rb
CHANGED
@@ -102,7 +102,11 @@ EOF
|
|
102
102
|
|
103
103
|
record_name, fields = capture_fields(params)
|
104
104
|
record = Element.new record_name
|
105
|
-
fields.each
|
105
|
+
fields.each do |k,v|
|
106
|
+
element = Element.new(k.to_s)
|
107
|
+
element.text = v if v
|
108
|
+
record.add element
|
109
|
+
end
|
106
110
|
|
107
111
|
ids = XPath.match(@doc.root,'records/*/attribute::id').map &:value
|
108
112
|
id = ids.empty? ? 1 : ids.max.succ
|