schematic 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,9 +27,9 @@ module Schematic
27
27
  output
28
28
  end
29
29
 
30
- def generate_xsd(builder, klass, options)
30
+ def generate_xsd(builder, klass, include_collection, options)
31
31
  xsd_generator.options = options
32
- xsd_generator.generate(builder, klass)
32
+ xsd_generator.generate(builder, klass, include_collection)
33
33
  end
34
34
 
35
35
  def ignore(*fields)
@@ -34,18 +34,18 @@ module Schematic
34
34
  end
35
35
  end
36
36
 
37
- def generate(builder, klass)
37
+ def generate(builder, klass, include_collection=true)
38
38
  nested_attributes.each do |nested_attribute|
39
39
  next if nested_attribute.klass == klass
40
40
  next if nested_attribute.klass == klass.superclass
41
41
  @options ||= {}
42
42
  @options[:generated_types] ||= []
43
43
  next if @options[:generated_types].include?(nested_attribute.klass)
44
- nested_attribute.klass.schematic_sandbox.generate_xsd(builder, klass, @options)
44
+ nested_attribute.klass.schematic_sandbox.generate_xsd(builder, klass, nested_attribute.macro == :has_many, @options)
45
45
  @options[:generated_types] << nested_attribute.klass
46
46
  end
47
47
 
48
- generate_complex_type_for_collection(builder)
48
+ generate_complex_type_for_collection(builder) if include_collection
49
49
  generate_complex_type_for_model(builder)
50
50
  end
51
51
 
@@ -1,3 +1,3 @@
1
1
  module Schematic
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
@@ -229,6 +229,7 @@ describe Schematic::Serializers::Xsd do
229
229
  it "should generate a valid XSD" do
230
230
  subject.should include "engine-attributes"
231
231
  subject.should_not include "engines-attributes"
232
+ subject.should_not include "Engines"
232
233
  validate_xsd(subject)
233
234
  end
234
235
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schematic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-09-21 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
16
- requirement: &2165083140 !ruby/object:Gem::Requirement
16
+ requirement: &2160906360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2165083140
24
+ version_requirements: *2160906360
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: builder
27
- requirement: &2165081880 !ruby/object:Gem::Requirement
27
+ requirement: &2160898860 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2165081880
35
+ version_requirements: *2160898860
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec-rails
38
- requirement: &2165080860 !ruby/object:Gem::Requirement
38
+ requirement: &2160897360 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '2.1'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2165080860
46
+ version_requirements: *2160897360
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: with_model
49
- requirement: &2165079840 !ruby/object:Gem::Requirement
49
+ requirement: &2160896060 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2165079840
57
+ version_requirements: *2160896060
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: nokogiri
60
- requirement: &2165078840 !ruby/object:Gem::Requirement
60
+ requirement: &2160893960 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2165078840
68
+ version_requirements: *2160893960
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sqlite3
71
- requirement: &2165077900 !ruby/object:Gem::Requirement
71
+ requirement: &2160893000 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2165077900
79
+ version_requirements: *2160893000
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: autotest
82
- requirement: &2165076920 !ruby/object:Gem::Requirement
82
+ requirement: &2160891200 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2165076920
90
+ version_requirements: *2160891200
91
91
  description: Automatic XSD generation from ActiveRecord models
92
92
  email:
93
93
  - casecommons-dev@googlegroups.com
@@ -153,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  segments:
155
155
  - 0
156
- hash: 4493981086317892751
156
+ hash: -4035158889682443836
157
157
  required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  none: false
159
159
  requirements:
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  version: '0'
163
163
  segments:
164
164
  - 0
165
- hash: 4493981086317892751
165
+ hash: -4035158889682443836
166
166
  requirements: []
167
167
  rubyforge_project: schematic
168
168
  rubygems_version: 1.8.10