activemodel-validators 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: cdecd79a81ab24c7e838e1ee0e8983bfaf901b07
4
- data.tar.gz: 67a9b577cbc12f1c29fc624527ef4a193bfd05fd
2
+ SHA256:
3
+ metadata.gz: 85caf1370d34f8f6127f4db4a492bc80aa812cbfd43eaa673e9a3cb95c951879
4
+ data.tar.gz: ad88d1e99e6408dc6310a3fc35134dff396b801b1b785c92de572a3210006cbb
5
5
  SHA512:
6
- metadata.gz: 5c9bb9ef4739163b3c22ac664d3856208112996fc80ca8a684b6d7f9b5479c52f5d8f9c15f1dfc8bb76a2565a8ad8abde745c284055e30ebecaa184096ab5ae3
7
- data.tar.gz: e428717cf8afffd6f87c2d377d364bfed90aed8c26f2a4de8a896e461e25e49229b806df5f48899d34cde1597313c75ec46338bf3a60c93c6de865040588558f
6
+ metadata.gz: 769995d1111d858955bbf8e174c13c5bf31fa9582036952e98b84daac57177275c9eab83220d2321127c3f587759c594034eef629cf8273172977884142ba759
7
+ data.tar.gz: d35dc900da9033663ed785a33049fddce55ec446492b18c6f8fd110543f4b7460fa5929b365d96a26131d796740593e4a550a5238930ecd5373c346f532db958
data/Readme.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ActiveModel Validators
2
2
  =======================
3
3
 
4
- A collection of Rails 3 ActiveModel Validators
4
+ A collection of Rails ActiveModel Validators
5
5
 
6
6
  Example Usage
7
7
  -------------
@@ -35,7 +35,6 @@ class Thing < ActiveRecord::Base
35
35
  validates :end_date, date: {required: true}
36
36
  validates :graduation_year, year: true
37
37
 
38
- validates :phone, phone: true
39
38
  validates :address_postal_code, postal_code: true
40
39
  validates :address_state, address_state: true
41
40
  end
@@ -59,7 +58,6 @@ Documentation
59
58
  * [DateValidator](activemodel-validators/blob/master/lib/activemodel-validators/date_validator.rb)
60
59
  * [YearValidator](activemodel-validators/blob/master/lib/activemodel-validators/year_validator.rb)
61
60
 
62
- * [PhoneValidator](activemodel-validators/blob/master/lib/activemodel-validators/phone_validator.rb)
63
61
  * [PostalCodeValidator](activemodel-validators/blob/master/lib/activemodel-validators/postal_code_validator.rb)
64
62
  * [AddressStateValidator](activemodel-validators/blob/master/lib/activemodel-validators/address_state_validator.rb)
65
63
 
@@ -117,6 +115,8 @@ Other collections not worth taking a look at:
117
115
  Specialized validators that stand on their own:
118
116
  -----------------------------------------------
119
117
 
118
+ * https://github.com/daddyz/phonelib (`phone: true`)
119
+ * https://github.com/perfectline/validates_url
120
120
  * https://github.com/balexand/email_validator
121
121
 
122
122
 
@@ -15,4 +15,3 @@ en:
15
15
 
16
16
  year_invalid: "is not a valid year (must be a number between %{min} and %{max})"
17
17
  date_invalid: "is not a valid date (must be in %{expected_format} format)"
18
- must_have_at_least_10_digits: "must have at least 10 digits"
@@ -1,5 +1,5 @@
1
1
  module Activemodel
2
2
  module Validators
3
- Version = "2.0.0"
3
+ Version = "3.0.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemodel-validators
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Rick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-25 00:00:00.000000000 Z
11
+ date: 2019-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activerecord
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: 'Some reusable ActiveModel validations, including greater_than, boolean_presence,
@@ -60,8 +60,8 @@ executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - .gitignore
64
- - .rspec
63
+ - ".gitignore"
64
+ - ".rspec"
65
65
  - Gemfile
66
66
  - Rakefile
67
67
  - Readme.md
@@ -80,7 +80,6 @@ files:
80
80
  - lib/activemodel-validators/less_or_greater_than_validator.rb
81
81
  - lib/activemodel-validators/less_than_validator.rb
82
82
  - lib/activemodel-validators/multiple_of_validator.rb
83
- - lib/activemodel-validators/phone_validator.rb
84
83
  - lib/activemodel-validators/postal_code_validator.rb
85
84
  - lib/activemodel-validators/rails.rb
86
85
  - lib/activemodel-validators/restrict_to_validator.rb
@@ -105,17 +104,16 @@ require_paths:
105
104
  - lib
106
105
  required_ruby_version: !ruby/object:Gem::Requirement
107
106
  requirements:
108
- - - '>='
107
+ - - ">="
109
108
  - !ruby/object:Gem::Version
110
109
  version: '0'
111
110
  required_rubygems_version: !ruby/object:Gem::Requirement
112
111
  requirements:
113
- - - '>='
112
+ - - ">="
114
113
  - !ruby/object:Gem::Version
115
114
  version: '0'
116
115
  requirements: []
117
- rubyforge_project: activemodel-validators
118
- rubygems_version: 2.1.5
116
+ rubygems_version: 3.0.3
119
117
  signing_key:
120
118
  specification_version: 4
121
119
  summary: Some reusable ActiveModel validations
@@ -1,8 +0,0 @@
1
- class PhoneValidator < ActiveModel::EachValidator
2
- def validate_each(record, attribute, value)
3
- return if value.blank?
4
- unless value.to_s.gsub(/[\s-]+/, '').length >= 10
5
- record.errors.add attribute, :must_have_at_least_10_digits
6
- end
7
- end
8
- end