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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7dfd65dec2a7653b43626f176d0f0581035abc6c
4
- data.tar.gz: f4dcb2b9dec41441888a012d4f15dc50a6c59351
3
+ metadata.gz: 6258d34bf405d21f73b8a713003059e6c9fa4eb4
4
+ data.tar.gz: bf4a7649c64c0783d1b4353ecf1625967de83903
5
5
  SHA512:
6
- metadata.gz: 364179505b2f416355f7c0d7b7c60d81c10069a5591bb5f156db510ddec3c9b14e321c0f4607188e91e033b6ff8030bd4a0a79e74558a4353c7075ddc5536b19
7
- data.tar.gz: 3cf4d15b751a5ace2e1de99c063904bcc74a781e5d430e6092d8d62c1fc2cfa25258ddf18300f289c911627dd8c0e38a8c17e50a04166f228384904a14fbf89a
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(permit(params)))
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
- params.permit(config.keys)
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
@@ -1,3 +1,3 @@
1
1
  module ParamsParser
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: params_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Swan