Permalink
Browse files

bug fix: added the keword root to record

  • Loading branch information...
1 parent 1872a99 commit 2c16ac2f590c74a34e7605d09413fb6fc0eee002 Your Name committed Jan 19, 2012
Showing with 5 additions and 5 deletions.
  1. +1 −1 lib/polyrex-createobject.rb
  2. +3 −3 lib/polyrex-createobject.rb~
  3. +1 −1 polyrex-createobject.gemspec
@@ -89,7 +89,7 @@ def create_node(parent_node, child_schema, params={}, id=nil)
record.root.add_attribute({'id' => @@id.to_s.clone})
a = child_schema[/[^\[]+(?=\])/].split(',')
- summary = record.element('summary')
+ summary = record.root.element('summary')
a.each do |field_name|
field = summary.element(field_name.strip)
field.text = params[field_name.strip.to_sym]
View
6 lib/polyrex-createobject.rb~ 100644 → 100755
@@ -22,7 +22,7 @@ class PolyrexCreateObject
end
- def id=(s) @@id = s end
+ def id=(s) @@id = s; self end
def id() @@id end
def record=(node)
@@ -77,10 +77,10 @@ end
record = Rexle.new PolyrexSchema.new(child_schema).to_s
if id then
- @@id = id
+ @@id.succ!
else
if @@id.to_i.to_s == @@id.to_s then
- @@id = @id.to_s.succ
+ @@id.succ!
else
@@id = @parent_node.element('count(//@id)').to_i + 2
end
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'polyrex-createobject'
- s.version = '0.4.10'
+ s.version = '0.4.11'
s.summary = 'polyrex-createobject'
s.files = Dir['lib/**/*.rb']
s.add_dependency('polyrex-schema')

0 comments on commit 2c16ac2

Please sign in to comment.