database_validation 0.0.3 → 0.0.4

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, 3]
9
+ VERSION = [0, 0, 4]
10
10
 
11
11
  end
@@ -23,7 +23,7 @@ module DatabaseValidation
23
23
  maximum = unsigned ? 2 ** (8 * field.limit) : 2 ** (8 * field.limit) / 2
24
24
  minimum = unsigned ? -(2 ** (8 * field.limit)) - 1 : -(2 ** (8 * field.limit) / 2) - 1
25
25
  base.send(:validates_numericality_of, field.name.to_sym, :less_than => maximum, :greater_than => minimum, :allow_nil => allow_nil)
26
- else
26
+ elsif [:string, :text].include?(field.type)
27
27
  maximum = field.limit
28
28
  base.send(:validates_length_of, field.name.to_sym, :maximum => maximum, :allow_nil => allow_nil)
29
29
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
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-21 00:00:00 -05:00
17
+ date: 2011-01-26 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency