modalfields 1.4.6 → 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.4.6
1
+ 1.4.7
@@ -102,11 +102,13 @@ module ModalFields
102
102
  end
103
103
  if ModalFields.validate(declaration)
104
104
  @model.fields_info << declaration
105
- if declaration.specifiers.include?(:unique)
106
- @model.validates_uniqueness_of declaration.name
107
- end
108
- if declaration.specifiers.include?(:required)
109
- @model.validates_presence_of declaration.name
105
+ if @model.columns.detect{|c| c.name==declaration.name.to_s}
106
+ if declaration.specifiers.include?(:unique)
107
+ @model.validates_uniqueness_of declaration.name
108
+ end
109
+ if declaration.specifiers.include?(:required)
110
+ @model.validates_presence_of declaration.name
111
+ end
110
112
  end
111
113
  end
112
114
  end
data/modalfields.gemspec CHANGED
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "modalfields"
8
- s.version = "1.4.6"
7
+ s.name = %q{modalfields}
8
+ s.version = "1.4.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Javier Goizueta"]
12
- s.date = "2012-10-15"
13
- s.description = "ModelFields is a Rails plugin that adds fields declarations to your models."
14
- s.email = "jgoizueta@gmail.com"
12
+ s.date = %q{2012-10-18}
13
+ s.description = %q{ModelFields is a Rails plugin that adds fields declarations to your models.}
14
+ s.email = %q{jgoizueta@gmail.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.rdoc",
@@ -56,13 +56,14 @@ Gem::Specification.new do |s|
56
56
  "test/test_diff.rb",
57
57
  "test/test_update.rb"
58
58
  ]
59
- s.homepage = "http://github.com/jgoizueta/modalfields"
59
+ s.homepage = %q{http://github.com/jgoizueta/modalfields}
60
60
  s.licenses = ["MIT"]
61
61
  s.require_paths = ["lib"]
62
- s.rubygems_version = "1.8.23"
63
- s.summary = "Model annotator with Ruby (Hobo-like) syntax and hooks."
62
+ s.rubygems_version = %q{1.3.7}
63
+ s.summary = %q{Model annotator with Ruby (Hobo-like) syntax and hooks.}
64
64
 
65
65
  if s.respond_to? :specification_version then
66
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
66
67
  s.specification_version = 3
67
68
 
68
69
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
metadata CHANGED
@@ -1,185 +1,172 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: modalfields
3
- version: !ruby/object:Gem::Version
4
- version: 1.4.6
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 4
8
+ - 7
9
+ version: 1.4.7
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Javier Goizueta
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2012-10-15 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2012-10-18 00:00:00 +02:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: modalsettings
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
22
30
  type: :runtime
23
31
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
31
34
  name: activesupport
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 2
42
+ - 3
43
+ - 5
37
44
  version: 2.3.5
38
45
  type: :runtime
39
46
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: 2.3.5
46
- - !ruby/object:Gem::Dependency
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
47
49
  name: activerecord
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 2
57
+ - 3
58
+ - 5
53
59
  version: 2.3.5
54
60
  type: :runtime
55
61
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: 2.3.5
62
- - !ruby/object:Gem::Dependency
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
63
64
  name: shoulda
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ segments:
71
+ - 0
72
+ version: "0"
70
73
  type: :development
71
74
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
78
- - !ruby/object:Gem::Dependency
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
79
77
  name: rdoc
80
- requirement: !ruby/object:Gem::Requirement
78
+ requirement: &id005 !ruby/object:Gem::Requirement
81
79
  none: false
82
- requirements:
80
+ requirements:
83
81
  - - ~>
84
- - !ruby/object:Gem::Version
85
- version: '3.12'
82
+ - !ruby/object:Gem::Version
83
+ segments:
84
+ - 3
85
+ - 12
86
+ version: "3.12"
86
87
  type: :development
87
88
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ~>
92
- - !ruby/object:Gem::Version
93
- version: '3.12'
94
- - !ruby/object:Gem::Dependency
89
+ version_requirements: *id005
90
+ - !ruby/object:Gem::Dependency
95
91
  name: bundler
96
- requirement: !ruby/object:Gem::Requirement
92
+ requirement: &id006 !ruby/object:Gem::Requirement
97
93
  none: false
98
- requirements:
94
+ requirements:
99
95
  - - ~>
100
- - !ruby/object:Gem::Version
101
- version: '1'
96
+ - !ruby/object:Gem::Version
97
+ segments:
98
+ - 1
99
+ version: "1"
102
100
  type: :development
103
101
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ~>
108
- - !ruby/object:Gem::Version
109
- version: '1'
110
- - !ruby/object:Gem::Dependency
102
+ version_requirements: *id006
103
+ - !ruby/object:Gem::Dependency
111
104
  name: jeweler
112
- requirement: !ruby/object:Gem::Requirement
105
+ requirement: &id007 !ruby/object:Gem::Requirement
113
106
  none: false
114
- requirements:
107
+ requirements:
115
108
  - - ~>
116
- - !ruby/object:Gem::Version
109
+ - !ruby/object:Gem::Version
110
+ segments:
111
+ - 1
112
+ - 8
113
+ - 3
117
114
  version: 1.8.3
118
115
  type: :development
119
116
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ~>
124
- - !ruby/object:Gem::Version
125
- version: 1.8.3
126
- - !ruby/object:Gem::Dependency
117
+ version_requirements: *id007
118
+ - !ruby/object:Gem::Dependency
127
119
  name: sqlite3
128
- requirement: !ruby/object:Gem::Requirement
129
- none: false
130
- requirements:
131
- - - ! '>='
132
- - !ruby/object:Gem::Version
133
- version: '0'
120
+ requirement: &id008 !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ segments:
126
+ - 0
127
+ version: "0"
134
128
  type: :development
135
129
  prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ! '>='
140
- - !ruby/object:Gem::Version
141
- version: '0'
142
- - !ruby/object:Gem::Dependency
130
+ version_requirements: *id008
131
+ - !ruby/object:Gem::Dependency
143
132
  name: pg
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - ! '>='
148
- - !ruby/object:Gem::Version
149
- version: '0'
133
+ requirement: &id009 !ruby/object:Gem::Requirement
134
+ none: false
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ segments:
139
+ - 0
140
+ version: "0"
150
141
  type: :development
151
142
  prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - ! '>='
156
- - !ruby/object:Gem::Version
157
- version: '0'
158
- - !ruby/object:Gem::Dependency
143
+ version_requirements: *id009
144
+ - !ruby/object:Gem::Dependency
159
145
  name: rails
160
- requirement: !ruby/object:Gem::Requirement
161
- none: false
162
- requirements:
163
- - - ! '>='
164
- - !ruby/object:Gem::Version
146
+ requirement: &id010 !ruby/object:Gem::Requirement
147
+ none: false
148
+ requirements:
149
+ - - ">="
150
+ - !ruby/object:Gem::Version
151
+ segments:
152
+ - 2
153
+ - 3
154
+ - 0
165
155
  version: 2.3.0
166
156
  type: :runtime
167
157
  prerelease: false
168
- version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
- requirements:
171
- - - ! '>='
172
- - !ruby/object:Gem::Version
173
- version: 2.3.0
158
+ version_requirements: *id010
174
159
  description: ModelFields is a Rails plugin that adds fields declarations to your models.
175
160
  email: jgoizueta@gmail.com
176
161
  executables: []
162
+
177
163
  extensions: []
178
- extra_rdoc_files:
164
+
165
+ extra_rdoc_files:
179
166
  - LICENSE.txt
180
167
  - README.rdoc
181
168
  - TODO
182
- files:
169
+ files:
183
170
  - .document
184
171
  - Gemfile
185
172
  - Gemfile.lock
@@ -217,32 +204,38 @@ files:
217
204
  - test/schema.rb
218
205
  - test/test_diff.rb
219
206
  - test/test_update.rb
207
+ has_rdoc: true
220
208
  homepage: http://github.com/jgoizueta/modalfields
221
- licenses:
209
+ licenses:
222
210
  - MIT
223
211
  post_install_message:
224
212
  rdoc_options: []
225
- require_paths:
213
+
214
+ require_paths:
226
215
  - lib
227
- required_ruby_version: !ruby/object:Gem::Requirement
216
+ required_ruby_version: !ruby/object:Gem::Requirement
228
217
  none: false
229
- requirements:
230
- - - ! '>='
231
- - !ruby/object:Gem::Version
232
- version: '0'
233
- segments:
218
+ requirements:
219
+ - - ">="
220
+ - !ruby/object:Gem::Version
221
+ hash: -658293137
222
+ segments:
234
223
  - 0
235
- hash: -4428809271904174224
236
- required_rubygems_version: !ruby/object:Gem::Requirement
224
+ version: "0"
225
+ required_rubygems_version: !ruby/object:Gem::Requirement
237
226
  none: false
238
- requirements:
239
- - - ! '>='
240
- - !ruby/object:Gem::Version
241
- version: '0'
227
+ requirements:
228
+ - - ">="
229
+ - !ruby/object:Gem::Version
230
+ segments:
231
+ - 0
232
+ version: "0"
242
233
  requirements: []
234
+
243
235
  rubyforge_project:
244
- rubygems_version: 1.8.23
236
+ rubygems_version: 1.3.7
245
237
  signing_key:
246
238
  specification_version: 3
247
239
  summary: Model annotator with Ruby (Hobo-like) syntax and hooks.
248
240
  test_files: []
241
+