dynarex 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dynarex.rb +2 -5
- metadata +1 -1
data/lib/dynarex.rb
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
|
5
5
|
require 'nokogiri'
|
6
6
|
require 'open-uri'
|
7
|
-
require 'builder'
|
8
7
|
require 'ostruct'
|
9
8
|
require 'dynarex-import'
|
10
9
|
require 'rexle'
|
@@ -212,8 +211,6 @@ EOF
|
|
212
211
|
load_records
|
213
212
|
self
|
214
213
|
end
|
215
|
-
|
216
|
-
|
217
214
|
|
218
215
|
#Create a record from a string, given the dynarex document contains a format mask.
|
219
216
|
# dynarex = Dynarex.new 'contacts/contact(name,age,dob)'
|
@@ -249,7 +246,7 @@ EOF
|
|
249
246
|
|
250
247
|
def delete(x)
|
251
248
|
|
252
|
-
if x.to_i.to_s
|
249
|
+
if x.to_i.to_s == x.to_s and x[/[0-9]/] then
|
253
250
|
@doc.delete("records/*[@id='#{x}']")
|
254
251
|
else
|
255
252
|
@doc.delete x
|
@@ -450,7 +447,7 @@ end))
|
|
450
447
|
i += 1; id = i.to_s
|
451
448
|
end
|
452
449
|
created = row.attributes['created'] if row.attributes['created']
|
453
|
-
last_modified = row.attributes[
|
450
|
+
last_modified = row.attributes[:last_modified] if row.attributes[:last_modified]
|
454
451
|
body = row.xpath('*').inject({}) do |r,node|
|
455
452
|
r.merge node.name.to_sym => node.text
|
456
453
|
end
|