validation_kit 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/validation_kit/email_validator/email_validator.rb +1 -1
- data/lib/validation_kit/mixed_case_validator/mixed_case_validator.rb +1 -1
- data/lib/validation_kit/phone_validator/phone_validator.rb +2 -2
- data/lib/validation_kit/postal_code_validator/postal_code_validator.rb +1 -1
- data/lib/validation_kit/version.rb +1 -1
- metadata +2 -2
@@ -14,7 +14,7 @@ module ValidationKit
|
|
14
14
|
:default => [:"activerecord.errors.models.#{model_name.underscore}.invalid",
|
15
15
|
options[:message],
|
16
16
|
:'activerecord.errors.messages.invalid'])
|
17
|
-
record.errors
|
17
|
+
record.errors.add(attribute, message)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -37,12 +37,12 @@ module ValidationKit
|
|
37
37
|
options[:message], :'activerecord.errors.messages.invalid'])
|
38
38
|
|
39
39
|
unless (options[:allow_blank] && new_value.blank?) || new_value =~ current_regex
|
40
|
-
record.errors
|
40
|
+
record.errors.add(attribute, message)
|
41
41
|
else
|
42
42
|
if options[:set]
|
43
43
|
formatted_phone = format_as_phone(value, country, options[:area_key])
|
44
44
|
if formatted_phone.nil?
|
45
|
-
record.errors
|
45
|
+
record.errors.add(attribute, message)
|
46
46
|
else
|
47
47
|
record.send(attribute.to_s + '=', formatted_phone)
|
48
48
|
end
|
@@ -51,7 +51,7 @@ module ValidationKit
|
|
51
51
|
:default => [:"activerecord.errors.models.#{model_name.underscore}.invalid",
|
52
52
|
options[:message],
|
53
53
|
:'activerecord.errors.messages.invalid'])
|
54
|
-
record.errors
|
54
|
+
record.errors.add(attribute, message)
|
55
55
|
else
|
56
56
|
record.send(attribute.to_s + '=',
|
57
57
|
format_as_postal_code(new_value, country, disallowed_characters)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: validation_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-03-
|
13
|
+
date: 2012-03-14 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: A collection of various validators for Rails forms
|
16
16
|
email:
|