polyrex-createobject 0.4.9 → 0.4.11

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 +4 -4
  2. metadata +4 -4
@@ -22,7 +22,7 @@ class PolyrexCreateObject
22
22
 
23
23
  end
24
24
 
25
- def id=(s) @@id = s end
25
+ def id=(s) @@id = s; self end
26
26
  def id() @@id end
27
27
 
28
28
  def record=(node)
@@ -77,10 +77,10 @@ end
77
77
  record = Rexle.new PolyrexSchema.new(child_schema).to_s
78
78
 
79
79
  if id then
80
- @@id = id
80
+ @@id.succ!
81
81
  else
82
82
  if @@id.to_i.to_s == @@id.to_s then
83
- @@id = @id.to_s.succ
83
+ @@id.succ!
84
84
  else
85
85
  @@id = @parent_node.element('count(//@id)').to_i + 2
86
86
  end
@@ -89,7 +89,7 @@ end
89
89
  record.root.add_attribute({'id' => @@id.to_s.clone})
90
90
 
91
91
  a = child_schema[/[^\[]+(?=\])/].split(',')
92
- summary = record.element('summary')
92
+ summary = record.root.element('summary')
93
93
  a.each do |field_name|
94
94
  field = summary.element(field_name.strip)
95
95
  field.text = params[field_name.strip.to_sym]
metadata CHANGED
@@ -2,15 +2,15 @@
2
2
  name: polyrex-createobject
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.9
5
+ version: 0.4.11
6
6
  platform: ruby
7
- authors: []
8
-
7
+ authors:
8
+ - James Robertson
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-15 00:00:00 +00:00
13
+ date: 2012-01-19 00:00:00 +00:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency