validates_and_formats_phones 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,7 +28,7 @@ module ValidatesAndFormatsPhones
28
28
  size_options = formats.collect {|format| format.count '#'}
29
29
 
30
30
  validates_each(*args) do |record, attr, value|
31
- unless (value.present? && size_options.include?(value.scan(/\d/).size)) || options[:allow_nil]
31
+ unless value.blank? || size_options.include?(value.scan(/\d/).size)
32
32
  if size_options.size > 1
33
33
  last = size_options.pop
34
34
  message = "must have #{size_options.join(', ')} or #{last} digits."
@@ -1,3 +1,3 @@
1
1
  module ValidatesAndFormatsPhones
2
- VERSION= '0.0.9'
2
+ VERSION= '0.0.10'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates_and_formats_phones
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 9
10
- version: 0.0.9
9
+ - 10
10
+ version: 0.0.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bernardo Telles