validation_profiler 0.1.6 → 0.1.7
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.
- checksums.yaml +4 -4
- data/lib/validation_profiler/rules/rules.rb +5 -0
- data/lib/validation_profiler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 889d6b045a26bfb27169cd2c89fe277c2c6faa78
|
|
4
|
+
data.tar.gz: 03cf41b6dfd380d80e1ccde8afd0698cb94fed3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6bd8ac120494e29cbc733955e3f6ff2563b5c7196070ae199fcf9e5f76b4fa0d0457b506291fda21d6beb38a27c84fc617221008d3d1d2fc901fa93692f3c4ea
|
|
7
|
+
data.tar.gz: f9478bd243eb9fa62adf00b11f3e0b02c9ce245712b3f4fc32fe52f57e28dc180af385abb2084edbff8c9c53a4107d266d3b7ddfa302e98a1fc9d596d9192565
|
|
@@ -115,6 +115,11 @@ class LengthValidationRule < ValidationRule
|
|
|
115
115
|
#attempt to get the field value from the object
|
|
116
116
|
field_value = get_field_value(obj, field)
|
|
117
117
|
|
|
118
|
+
#check if this validation check should be skipped
|
|
119
|
+
if !is_required?(field_value, attributes)
|
|
120
|
+
return true
|
|
121
|
+
end
|
|
122
|
+
|
|
118
123
|
if field_value.is_a?(Array)
|
|
119
124
|
length = field_value.length
|
|
120
125
|
else
|