schematic 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -112,7 +112,8 @@ module Schematic
112
112
  additional_methods.each do |method_name, values|
113
113
  method_xsd_name = method_name.to_s.dasherize
114
114
  if values.present?
115
- builder.xs :element, "name" => method_xsd_name, "minOccurs" => "0", "maxOccurs" => "1" do |element|
115
+ max_occurrences = values.is_a?(Hash) ? {} : {"maxOccurs" => "1"}
116
+ builder.xs :element, {"name" => method_xsd_name, "minOccurs" => "0"}.merge(max_occurrences) do |element|
116
117
  element.xs :complexType do |complex_type|
117
118
  complex_type.xs :all do |nested_all|
118
119
  if values.is_a?(Array)
@@ -1,3 +1,3 @@
1
1
  module Schematic
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -58,7 +58,7 @@ describe Schematic::Serializers::Xsd do
58
58
 
59
59
  class << self
60
60
  def xsd_methods
61
- {:foo => { :bar => { :baz => nil } } }
61
+ {:foo => { :bar => { :baz => nil }, :quz => [:qaz] } }
62
62
  end
63
63
  end
64
64
  end
@@ -240,10 +240,6 @@ describe Schematic::Serializers::Xsd do
240
240
  end
241
241
  end
242
242
 
243
- describe "nested attributes" do
244
-
245
- end
246
-
247
243
  end
248
244
 
249
245
  context "with a model with validations" do
@@ -446,10 +442,10 @@ describe Schematic::Serializers::Xsd do
446
442
  </xs:simpleContent>
447
443
  </xs:complexType>
448
444
  </xs:element>
449
- <xs:element name="foo" minOccurs="0" maxOccurs="1">
445
+ <xs:element name="foo" minOccurs="0">
450
446
  <xs:complexType>
451
447
  <xs:all>
452
- <xs:element name="bar" minOccurs="0" maxOccurs="1">
448
+ <xs:element name="bar" minOccurs="0">
453
449
  <xs:complexType>
454
450
  <xs:all>
455
451
  <xs:element name="baz" minOccurs="0" maxOccurs="1"/>
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: schematic
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.6
5
+ version: 0.0.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Case Commons, LLC