polyrex-createobject 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/polyrex-createobject.rb +4 -0
- metadata +1 -1
data/lib/polyrex-createobject.rb
CHANGED
@@ -35,10 +35,12 @@ class PolyrexCreateObject
|
|
35
35
|
|
36
36
|
orig_parent = @parent_node
|
37
37
|
new_parent = create_node(@parent_node, @rpaths['#{xpath}'], params, id).element('records')
|
38
|
+
|
38
39
|
if block_given? then
|
39
40
|
self.record = new_parent
|
40
41
|
blk.call(self)
|
41
42
|
end
|
43
|
+
|
42
44
|
self.record = orig_parent
|
43
45
|
|
44
46
|
self
|
@@ -51,9 +53,11 @@ class PolyrexCreateObject
|
|
51
53
|
# top record
|
52
54
|
methodx << %Q(
|
53
55
|
def #{name}(params={}, id=nil,&blk)
|
56
|
+
orig_parent = @parent_node
|
54
57
|
self.record = @parent_node.element('records') unless @parent_node.name == 'records'
|
55
58
|
self.record = create_node(@parent_node, @rpaths['#{xpath}'], params, id).element('records')
|
56
59
|
blk.call(self) if block_given?
|
60
|
+
self.record = orig_parent
|
57
61
|
|
58
62
|
self
|
59
63
|
end
|