stronger_parameters 2.14.1.1 → 2.16.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce9ec4b63f79317aa849950dcb6431c4fd0c3a5515abc3eb88aaa170f5680355
|
4
|
+
data.tar.gz: 85cc4373897928267c81214cdf1ca1207a705ee93f32cc647be65c02c0dcbb56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f4bd6274fdf4a44431fbb1cf87e93ba2393c2d0e78c65d3fe6fe4afdde77f1abd6a7ff24e87216cb622ed43795f1900a10f825915f1bcb04f62ef5bd62eca2d
|
7
|
+
data.tar.gz: 97d87e0b66db0f5c125b136385b379f72c4af95e17599c1a3f270ea0268af2f27d3532831b83f84b233492131962f9782ef35513963d1dde53ad73ad89e7e818
|
@@ -6,8 +6,7 @@ module StrongerParameters
|
|
6
6
|
module PermittedParameters
|
7
7
|
def self.included(klass)
|
8
8
|
klass.extend ClassMethods
|
9
|
-
|
10
|
-
klass.public_send method, :permit_parameters
|
9
|
+
klass.before_action :permit_parameters
|
11
10
|
end
|
12
11
|
|
13
12
|
def self.sugar(value)
|
@@ -91,7 +90,7 @@ module StrongerParameters
|
|
91
90
|
|
92
91
|
return if log_unpermitted
|
93
92
|
|
94
|
-
|
93
|
+
params.send(:parameters).replace(permitted_params)
|
95
94
|
params.permit!
|
96
95
|
request.params.replace(permitted_params)
|
97
96
|
|
@@ -129,7 +128,7 @@ module StrongerParameters
|
|
129
128
|
end
|
130
129
|
|
131
130
|
def flat_keys(hash)
|
132
|
-
hash = hash.send(:parameters) if
|
131
|
+
hash = hash.send(:parameters) if hash.is_a?(ActionController::Parameters)
|
133
132
|
hash.flat_map { |k, v| v.is_a?(Hash) ? flat_keys(v).map { |x| "#{k}.#{x}" }.push(k) : k }
|
134
133
|
end
|
135
134
|
end
|
@@ -109,7 +109,7 @@ module StrongerParameters
|
|
109
109
|
end
|
110
110
|
|
111
111
|
def datetime_iso8601
|
112
|
-
DateTimeIso8601Constraint.new
|
112
|
+
DateTimeIso8601Constraint.new # uncovered
|
113
113
|
end
|
114
114
|
|
115
115
|
def file
|
@@ -154,7 +154,7 @@ module StrongerParameters
|
|
154
154
|
elsif constraint.required?
|
155
155
|
result = InvalidValue.new(nil, 'must be present')
|
156
156
|
else
|
157
|
-
next
|
157
|
+
next # uncovered
|
158
158
|
end
|
159
159
|
|
160
160
|
if result.is_a?(InvalidValue)
|
@@ -190,8 +190,7 @@ module StrongerParameters
|
|
190
190
|
# TODO: this is not consistent with the behavior of raising ActionController::UnpermittedParameters
|
191
191
|
# should have the same render vs raise behavior in test/dev ... see permitted_parameters_test.rb
|
192
192
|
rescue_from(StrongerParameters::InvalidParameter) do |e|
|
193
|
-
|
194
|
-
render type => e.message, :status => :bad_request
|
193
|
+
render plain: e.message, status: :bad_request # uncovered
|
195
194
|
end
|
196
195
|
end
|
197
196
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stronger_parameters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mick Staugaard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -142,20 +142,20 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
145
|
+
version: '5.0'
|
146
146
|
- - "<"
|
147
147
|
- !ruby/object:Gem::Version
|
148
|
-
version: '
|
148
|
+
version: '7.1'
|
149
149
|
type: :runtime
|
150
150
|
prerelease: false
|
151
151
|
version_requirements: !ruby/object:Gem::Requirement
|
152
152
|
requirements:
|
153
153
|
- - ">="
|
154
154
|
- !ruby/object:Gem::Version
|
155
|
-
version: '
|
155
|
+
version: '5.0'
|
156
156
|
- - "<"
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version: '
|
158
|
+
version: '7.1'
|
159
159
|
description:
|
160
160
|
email:
|
161
161
|
- mick@zendesk.com
|
@@ -190,7 +190,8 @@ files:
|
|
190
190
|
homepage: https://github.com/zendesk/stronger_parameters
|
191
191
|
licenses:
|
192
192
|
- Apache License Version 2.0
|
193
|
-
metadata:
|
193
|
+
metadata:
|
194
|
+
rubygems_mfa_required: 'true'
|
194
195
|
post_install_message:
|
195
196
|
rdoc_options: []
|
196
197
|
require_paths:
|
@@ -206,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
207
|
- !ruby/object:Gem::Version
|
207
208
|
version: '0'
|
208
209
|
requirements: []
|
209
|
-
rubygems_version: 3.
|
210
|
+
rubygems_version: 3.1.6
|
210
211
|
signing_key:
|
211
212
|
specification_version: 4
|
212
213
|
summary: Type checking and type casting of parameters for Action Pack
|