polyrex-createobject 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/polyrex-createobject.rb +10 -4
- metadata +1 -1
data/lib/polyrex-createobject.rb
CHANGED
@@ -32,8 +32,13 @@ class PolyrexCreateObject
|
|
32
32
|
%Q(
|
33
33
|
def #{name}(params={}, id=nil,&blk)
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
orig_parent = @parent_node
|
36
|
+
new_parent = create_node(@parent_node, @rpaths['#{xpath}'], params, id).element('records')
|
37
|
+
if block_given? then
|
38
|
+
self.record = new_parent
|
39
|
+
blk.call(self)
|
40
|
+
end
|
41
|
+
self.record = orig_parent
|
37
42
|
|
38
43
|
self
|
39
44
|
end
|
@@ -68,9 +73,10 @@ end
|
|
68
73
|
end
|
69
74
|
|
70
75
|
a = child_schema[/[^\[]+(?=\])/].split(',')
|
76
|
+
summary = record.element('summary')
|
71
77
|
a.each do |field_name|
|
72
|
-
field =
|
73
|
-
field.text = params[field_name.to_sym]
|
78
|
+
field = summary.element(field_name.strip)
|
79
|
+
field.text = params[field_name.strip.to_sym]
|
74
80
|
end
|
75
81
|
|
76
82
|
parent_node.add record.root
|