dynarex 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dynarex.rb +4 -2
- metadata +2 -2
data/lib/dynarex.rb
CHANGED
@@ -197,8 +197,10 @@ EOF
|
|
197
197
|
record.add element
|
198
198
|
end
|
199
199
|
|
200
|
-
|
201
|
-
|
200
|
+
unless id
|
201
|
+
ids = XPath.match(@doc.root,'records/*/attribute::id').map {|x| x.value.to_i}
|
202
|
+
id = ids.empty? ? (id || 1) : ids.max.succ
|
203
|
+
end
|
202
204
|
|
203
205
|
attributes = {id: id, created: Time.now.to_s, last_modified: nil}
|
204
206
|
attributes.each {|k,v| record.add_attribute(k.to_s, v)}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynarex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors: []
|
7
7
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-06-
|
12
|
+
date: 2010-06-24 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|