validation_kit 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- 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 +1 -1
@@ -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[attribute]
|
17
|
+
record.errors[attribute].add 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[attribute]
|
40
|
+
record.errors[attribute].add 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[attribute]
|
45
|
+
record.errors[attribute].add 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[attribute]
|
54
|
+
record.errors[attribute].add message
|
55
55
|
else
|
56
56
|
record.send(attribute.to_s + '=',
|
57
57
|
format_as_postal_code(new_value, country, disallowed_characters)
|