has_validated_attributes 1.0.2 → 1.0.3

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
2
  SHA1:
3
- metadata.gz: 44b8778accd86a1bd4e85d52a864b3cd174b0e2b
4
- data.tar.gz: cae2e36a005a6075290c799bd3187ce9f57fd8a3
3
+ metadata.gz: 602d4c79ed7b97aa059079f61e4c3370fd6f979f
4
+ data.tar.gz: ab76cf7ff7ecfd1e5149d31fe3d6a61b06d6dcf0
5
5
  SHA512:
6
- metadata.gz: f5193bde2f53f86d86684edfdb7cb74e8509f263135f7b0b6027071808e82641b5c58f19ed48aa99dba558efd5b188c509fd1148c78a156a127906dce79932f0
7
- data.tar.gz: fcb3dd82b04778557bdd7b941a1cc016bebba9cb3d5679e2f91a9b448a094b4e4c0077ef4d4eba70e4e988c8dbe40533df51873a7754c8ef5e2fbc90319e9e72
6
+ metadata.gz: 942bdad9be66a96dd36eef3b9f7a3a95cb01fcada8106a444d7adfd27f4e40b88d0e318e9a823326e9ea0b90eedc0bcff2ce0edd74de672ad5e64c0e5ffa60b5
7
+ data.tar.gz: c77c5cec9648ebc4e4d7c16592fefe5ed26b9bb261f171323325b02c586e1f7ed7a13bfc3b309681cd433bcc9d29e7b6d271ca5558ce824fdaf1f3fb145a12f0
@@ -46,7 +46,7 @@ module HasValidatedAttributes
46
46
  :positive_dollar => {:format => {:with => /\A[0-9]{0,12}(\.[0-9]{0,2})?\z/, :message => "accepts only numeric characters, period"}, :numericality => {:greater_than_or_equal_to => 0, :less_than => 1000000000000}, :allow_nil => true},
47
47
  :percent => {:format => {:with => /\A-?[0-9]{0,4}(\.[0-9]{0,4})?\z/, :message => "accepts only numeric characters, period, negative sign, and must be equal/less/greater than +/- 100"}, :numericality => {:greater_than_or_equal_to => -100, :less_than_or_equal_to => 100}, :has_if? => true},
48
48
  :positive_percent => {:format => {:with => /\A[0-9]{0,4}(\.[0-9]{0,4})?\z/, :message => "accepts only numeric characters, period, and must be equal/less than 100"}, :numericality => {:greater_than_or_equal_to => 0, :less_than_or_equal_to => 100}, :allow_nil => true},
49
- :url => {:length => {:maximum => 255}, :format => {:with => /\A(http|https|ftp):\/\/[A-Z0-9]+([\.]{1}[a-z0-9-]{1,63})*\.[a-zA-Z]{2,5}(:[0-9]{1,5})?(\/.*)?\z/ix, :message => "web address isnt valid"}, :has_if? => true},
49
+ :url => {:length => {:maximum => 255}, :format => {:with => URI.regexp, :message => "web address isnt valid"}, :has_if? => true},
50
50
  :social_security_number => {:length => {:is => 9}, :numericality => {:greater_than_or_equal_to => 0, :less_than => 1000000000, :message => "must be in the format 111-11-1111"}, :has_if? => true},
51
51
  :taxid => {:length => {:is => 9}, :numericality => {:greater_than_or_equal_to => 9999999, :less_than => 1000000000, :message => "must be in the format 11-1111111"}, :has_if? => true},
52
52
  :age => {:numericality => {:greater_than_or_equal_to => 0, :less_than_or_equal_to => 110, :message => 'must contain only 3 numbers and less than 110'}, :has_if? => true},
@@ -148,7 +148,7 @@ RSpec.shared_examples_for "url attribute" do |attr, allowed: nil, disallowed: ni
148
148
  end
149
149
 
150
150
  (disallowed || [
151
- "finance.example.com", "www.example.com", "www.example.com:8001", ">*", "< test",
151
+ "finance.example.com", "www.example.com", ">*", "< test",
152
152
  "www.test..com", "www.test.c", "www-test.com", "abc", "123", "&*()", "www.test-com"
153
153
  ]).each do |url|
154
154
  it { should_not allow_value(url).for(attr).with_message(HasValidatedAttributes.url_format[:format][:message]) }
@@ -1,3 +1,3 @@
1
1
  module HasValidatedAttributes
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_validated_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Ginavan