drexed-validators 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/validators/telephone_validator.rb +1 -1
- data/lib/drexed/validators/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f855d819073cb7caa88516343b5b926b4a76a9a
|
4
|
+
data.tar.gz: 384172213c562cb9a9d0b33bbf72d1f878ad912f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 939844cdc6f99729f6a4d4d98f725d558174b05862d77a884858ec59d127fcf3cdd4f43313888c17c17be21213590a34db9a0b23628f9d0d131077e5a209199c
|
7
|
+
data.tar.gz: c1088dbde0b6cc4a78733dde858bedd31981d8b1315b109cde96a5afc39e022a39f66c4bf44505732d5e23f78f90ec5b6b3f5b0e46eadd507eff0e0cc0bbe446
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class TelephoneValidator < ActiveModel::EachValidator
|
2
|
-
def validate_each(
|
2
|
+
def validate_each(object, attribute, value)
|
3
3
|
formatted_value = value.gsub(/[\s\.\+\(\)-]*/, "")
|
4
4
|
is_number = !(formatted_value =~ /^[-+]?[0-9]+$/).nil?
|
5
5
|
unless is_number && validate_by_region(options[:region], formatted_value)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drexed-validators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Gomez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|