ca-validation 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ca/validation/core_ext.rb +6 -5
- data/lib/ca/validation/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af4b07056a09c69e9faab3dd668ff56d136bd50f104255ba3a439e110b941ef0
|
4
|
+
data.tar.gz: 1a2390f622198e41f55f4bdfe3b265912e5ad369fd935af506715d800449df1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae6e4931daeebe24b60e6211fff6e47e8bfb21922d0ecf00758a078c05b65cffa76c108cba2bc280d068121ddc4666b04681e1eaeba9e7dd1f0ce0ae479e55ee
|
7
|
+
data.tar.gz: cafb8f9a50b1dbba9eaa9a65805647c567d64a243acd6e858280d62b5e71fbd3644bce171365fd1665a8f92e8d341340b67c642d51c53d141db4e229e42364c1
|
@@ -1,16 +1,17 @@
|
|
1
1
|
module ActionController
|
2
2
|
class Parameters
|
3
3
|
def valid?(validator)
|
4
|
-
|
4
|
+
dup_params = deep_dup
|
5
|
+
@result = validator.call(dup_params.permit!.to_hash)
|
5
6
|
@result.errors.empty?
|
6
7
|
end
|
7
8
|
|
8
|
-
def errors
|
9
|
-
@result.
|
9
|
+
def errors(full: false)
|
10
|
+
@result.messages(full: full)
|
10
11
|
end
|
11
12
|
|
12
|
-
def
|
13
|
-
@result.
|
13
|
+
def result
|
14
|
+
@result.to_hash
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|