polyrex-createobject 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/polyrex-createobject.rb +8 -7
  2. metadata +2 -2
@@ -31,9 +31,10 @@ class PolyrexCreateObject
31
31
 
32
32
  %Q(
33
33
  def #{name}(params={}, id=nil,&blk)
34
- self.record = @parent_node.element('records')
35
- self.record = create_node(@parent_node, @rpaths['#{xpath}'], params, id)
36
- blk.call(self) if blk
34
+
35
+ create_node(@parent_node, @rpaths['#{xpath}'], params, id).element('records')
36
+ blk.call(self) if block_given?
37
+
37
38
  self
38
39
  end
39
40
  )
@@ -43,9 +44,10 @@ class PolyrexCreateObject
43
44
 
44
45
  methodx << %Q(
45
46
  def #{name}(params={}, id=nil,&blk)
46
- self.record = @parent_node.element('records')
47
- self.record = create_node(@parent_node, @rpaths['#{xpath}'], params, id)
48
- blk.call(self) if blk
47
+ self.record = @parent_node.element('records') unless @parent_node.name == 'records'
48
+ self.record = create_node(@parent_node, @rpaths['#{xpath}'], params, id).element('records')
49
+ blk.call(self) if block_given?
50
+
49
51
  self
50
52
  end
51
53
  )
@@ -55,7 +57,6 @@ end
55
57
  end
56
58
 
57
59
  def create_node(parent_node, child_schema, params={}, id=nil)
58
-
59
60
  record = Rexle.new PolyrexSchema.new(child_schema).to_s
60
61
  @id = id if id
61
62
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polyrex-createobject
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
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-12-01 00:00:00 +00:00
12
+ date: 2010-12-25 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency