polyrex-createobject 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/polyrex-createobject.rb +1 -15
  2. metadata +1 -1
@@ -53,11 +53,10 @@ end
53
53
  end
54
54
 
55
55
  def create_node(parent_node, child_schema, params={}, id=nil)
56
- raise "create_node error: can't create record" unless valid_creation?
56
+
57
57
  record = Document.new PolyrexSchema.new(child_schema).to_s
58
58
  @id = id if id
59
59
 
60
- puts 'id : ' + @id.to_s
61
60
  record.root.add_attribute('id', @id.to_s)
62
61
  if @id.to_s[/[0-9]/] then
63
62
  @id = (@id.to_i + 1).to_s
@@ -75,19 +74,6 @@ end
75
74
  record
76
75
  end
77
76
 
78
- def valid_creation?()
79
-
80
- xpath = BacktrackXPath.new(@parent_node).to_s.gsub('//','/')
81
- path = xpath_to_rpath(xpath).sub(/\/?records$/,'')
82
- root_name = @schema[/^[^\/]+/]
83
- rpath = root_name + (path.length > 0 ? '/' + path : path)
84
-
85
- schema_rpath = @schema.gsub(/\[[^\]]+\]/,'')
86
- local_path = (schema_rpath.split('/') - rpath.split('/')).join('/')
87
- child_rpath = rpath + '/' + local_path
88
-
89
- @rpaths.has_key? child_rpath
90
- end
91
77
 
92
78
  def xpath_to_rpath(xpath)
93
79
  xpath.split('/').each_slice(2).map(&:last).join('/').gsub(/\[[^\]]+\]/,'')
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.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors: []
7
7