params_parser 0.0.4 → 0.0.5
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/params_parser/rails_integration.rb +9 -2
- data/lib/params_parser/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: 6258d34bf405d21f73b8a713003059e6c9fa4eb4
|
4
|
+
data.tar.gz: bf4a7649c64c0783d1b4353ecf1625967de83903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c433952804f4ee108f308cfbedc5c3572529bedfe93cd12b76d15e9dead6f74c7048e67b376b143593fc54b01550f94de7eaee52982ac3be08cf906bcd0bea48
|
7
|
+
data.tar.gz: f6240ca56ee79006e1fd113a402322e1b72eae095c79fd46780183f847d50115e8354080669336fc292118d1f0d69fdd57a07923171fc76b3d8eb14d62b4e3a2
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ParamsParser
|
2
2
|
module RailsIntegration
|
3
3
|
def parse(params)
|
4
|
-
permit(super(
|
4
|
+
permit(super(params))
|
5
5
|
end
|
6
6
|
|
7
7
|
private
|
@@ -9,7 +9,14 @@ module ParamsParser
|
|
9
9
|
def permit(params)
|
10
10
|
case params
|
11
11
|
when ActionController::Parameters
|
12
|
-
|
12
|
+
# The ParamsParser filters out parameters that are not explicitly
|
13
|
+
# configured and #parse creates a new object so we are safe to call
|
14
|
+
# #permit! here.
|
15
|
+
#
|
16
|
+
# 1. Any non configured parameters are already filtered out
|
17
|
+
# 2. A new object is created by #parse so we are not mutating and
|
18
|
+
# implicitly permitting the parameters that were passed in.
|
19
|
+
params.permit!
|
13
20
|
else
|
14
21
|
params
|
15
22
|
end
|