database_validation 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,6 @@ module DatabaseValidation
6
6
 
7
7
  private
8
8
 
9
- VERSION = [0, 0, 1]
9
+ VERSION = [0, 0, 2]
10
10
 
11
11
  end
@@ -14,7 +14,7 @@ module DatabaseValidation
14
14
  base.columns.each do |field|
15
15
  next if field.name == base.primary_key # don't add validations here
16
16
  allow_nil = field.null
17
- base.send(:validates_length_of, field.name.to_sym, :maximum => field.limit, :allow_nil => allow_nil)
17
+ base.send(:validates_length_of, field.name.to_sym, :maximum => field.limit, :allow_nil => allow_nil) unless field.limit.nil?
18
18
  base.send(:validates_presence_of, field.name.to_sym, :allow_nil => allow_nil) unless allow_nil
19
19
  end
20
20
  ActiveRecord::Base.connection.indexes(base.table_name).each do |key|
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Crepezzi
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-15 00:00:00 -05:00
17
+ date: 2011-01-21 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency