schematic 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,12 +36,16 @@ module Schematic
36
36
  return "1" if @required_methods.include?(@column.name.to_sym)
37
37
  @klass._validators[@column.name.to_sym].each do |column_validation|
38
38
  next unless column_validation.is_a? ActiveModel::Validations::PresenceValidator
39
- return "1" if column_validation.options[:allow_blank] != true && column_validation.options[:if].nil?
39
+ if column_validation.options[:allow_blank] != true &&
40
+ column_validation.options[:if].nil? &&
41
+ column_validation.options[:unless].nil?
42
+
43
+ return "1"
44
+ end
40
45
  end
41
46
  "0"
42
47
  end
43
48
 
44
-
45
49
  def map_type(column)
46
50
  Types::COMPLEX[column.type][:complex_type]
47
51
  end
@@ -1,3 +1,3 @@
1
1
  module Schematic
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
@@ -66,10 +66,12 @@ describe Schematic::Serializers::Xsd do
66
66
  with_model :some_model do
67
67
  table :id => false do |t|
68
68
  t.string "title"
69
+ t.string "description"
69
70
  end
70
71
 
71
72
  model do
72
73
  validates :title, :presence => true, :if => lambda { |model| false }
74
+ validates :description, :presence => true, :unless => lambda { |model| true }
73
75
  end
74
76
  end
75
77
 
@@ -84,6 +86,14 @@ describe Schematic::Serializers::Xsd do
84
86
  </xs:simpleContent>
85
87
  </xs:complexType>
86
88
  </xs:element>
89
+ <xs:element name="description" minOccurs="0" maxOccurs="1">
90
+ <xs:complexType>
91
+ <xs:simpleContent>
92
+ <xs:restriction base="String">
93
+ </xs:restriction>
94
+ </xs:simpleContent>
95
+ </xs:complexType>
96
+ </xs:element>
87
97
  XML
88
98
  end
89
99
 
metadata CHANGED
@@ -1,104 +1,100 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: schematic
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.4
4
5
  prerelease:
5
- version: 0.4.3
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Case Commons, LLC
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-08-10 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-08-19 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: activerecord
17
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &2153071180 !ruby/object:Gem::Requirement
18
17
  none: false
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
22
21
  version: 3.0.0
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
24
+ version_requirements: *2153071180
25
+ - !ruby/object:Gem::Dependency
27
26
  name: builder
28
- requirement: &id002 !ruby/object:Gem::Requirement
27
+ requirement: &2153070760 !ruby/object:Gem::Requirement
29
28
  none: false
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
34
33
  type: :runtime
35
34
  prerelease: false
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *2153070760
36
+ - !ruby/object:Gem::Dependency
38
37
  name: rspec-rails
39
- requirement: &id003 !ruby/object:Gem::Requirement
38
+ requirement: &2153070160 !ruby/object:Gem::Requirement
40
39
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: "2.1"
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '2.1'
45
44
  type: :development
46
45
  prerelease: false
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
46
+ version_requirements: *2153070160
47
+ - !ruby/object:Gem::Dependency
49
48
  name: with_model
50
- requirement: &id004 !ruby/object:Gem::Requirement
49
+ requirement: &2153069700 !ruby/object:Gem::Requirement
51
50
  none: false
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: "0"
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
56
55
  type: :development
57
56
  prerelease: false
58
- version_requirements: *id004
59
- - !ruby/object:Gem::Dependency
57
+ version_requirements: *2153069700
58
+ - !ruby/object:Gem::Dependency
60
59
  name: nokogiri
61
- requirement: &id005 !ruby/object:Gem::Requirement
60
+ requirement: &2153069200 !ruby/object:Gem::Requirement
62
61
  none: false
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: "0"
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
67
66
  type: :development
68
67
  prerelease: false
69
- version_requirements: *id005
70
- - !ruby/object:Gem::Dependency
68
+ version_requirements: *2153069200
69
+ - !ruby/object:Gem::Dependency
71
70
  name: sqlite3
72
- requirement: &id006 !ruby/object:Gem::Requirement
71
+ requirement: &2153068740 !ruby/object:Gem::Requirement
73
72
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: "0"
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
78
77
  type: :development
79
78
  prerelease: false
80
- version_requirements: *id006
81
- - !ruby/object:Gem::Dependency
79
+ version_requirements: *2153068740
80
+ - !ruby/object:Gem::Dependency
82
81
  name: autotest
83
- requirement: &id007 !ruby/object:Gem::Requirement
82
+ requirement: &2153068220 !ruby/object:Gem::Requirement
84
83
  none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: "0"
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
89
88
  type: :development
90
89
  prerelease: false
91
- version_requirements: *id007
90
+ version_requirements: *2153068220
92
91
  description: Automatic XSD generation from ActiveRecord models
93
- email:
92
+ email:
94
93
  - casecommons-dev@googlegroups.com
95
94
  executables: []
96
-
97
95
  extensions: []
98
-
99
96
  extra_rdoc_files: []
100
-
101
- files:
97
+ files:
102
98
  - .gitignore
103
99
  - .rspec
104
100
  - .rvmrc
@@ -145,38 +141,35 @@ files:
145
141
  - spec/xsd/xml.xsd
146
142
  homepage: https://github.com/Casecommons/schematic
147
143
  licenses: []
148
-
149
144
  post_install_message:
150
145
  rdoc_options: []
151
-
152
- require_paths:
146
+ require_paths:
153
147
  - lib
154
- required_ruby_version: !ruby/object:Gem::Requirement
148
+ required_ruby_version: !ruby/object:Gem::Requirement
155
149
  none: false
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- hash: 1643851491389570172
160
- segments:
150
+ requirements:
151
+ - - ! '>='
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ segments:
161
155
  - 0
162
- version: "0"
163
- required_rubygems_version: !ruby/object:Gem::Requirement
156
+ hash: 2874258645481789242
157
+ required_rubygems_version: !ruby/object:Gem::Requirement
164
158
  none: false
165
- requirements:
166
- - - ">="
167
- - !ruby/object:Gem::Version
168
- hash: 1643851491389570172
169
- segments:
159
+ requirements:
160
+ - - ! '>='
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ segments:
170
164
  - 0
171
- version: "0"
165
+ hash: 2874258645481789242
172
166
  requirements: []
173
-
174
167
  rubyforge_project: schematic
175
- rubygems_version: 1.8.5
168
+ rubygems_version: 1.8.6
176
169
  signing_key:
177
170
  specification_version: 3
178
171
  summary: Automatic XSD generation from ActiveRecord models
179
- test_files:
172
+ test_files:
180
173
  - spec/schematic/generator/restrictions/custom_spec.rb
181
174
  - spec/schematic/generator/restrictions/enumeration_spec.rb
182
175
  - spec/schematic/generator/restrictions/length_spec.rb