actionpack 7.1.0.beta1 → 7.1.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/action_controller/metal/strong_parameters.rb +33 -2
- data/lib/action_dispatch/journey/router.rb +4 -4
- data/lib/action_pack/gem_version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e68b0ebfc9d99e30e0fb040373df4cb2978db72f0fcf9aff1755ea0d03213d7
|
4
|
+
data.tar.gz: 71fb99934bfeadafa03c5a7fce1ea5a45fe1c210a38c66cbea5de2473155ef9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f7ec945d913eaea58cadd93bfd0f9a6f7408f3d34aa3c3f3cb366e3984793fed1dcb88c3c5a9952fcf79f653565e00634d329d2f25971ab33f7c57dadd0626e
|
7
|
+
data.tar.gz: 262c16442ea0e21425f631f59270b97466a7ac96066481bbe6b11734b55df92b57f49d0ab82f68a6ee876f7fda23378cb41eb2891e9ac7bd4e8d00c62d66a03b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## Rails 7.1.0.rc1 (September 27, 2023) ##
|
2
|
+
|
3
|
+
* Add support for `#deep_merge` and `#deep_merge!` to
|
4
|
+
`ActionController::Parameters`.
|
5
|
+
|
6
|
+
*Sean Doyle*
|
7
|
+
|
8
|
+
|
1
9
|
## Rails 7.1.0.beta1 (September 13, 2023) ##
|
2
10
|
|
3
11
|
* `AbstractController::Translation.raise_on_missing_translations` removed
|
@@ -4,6 +4,7 @@ require "active_support/core_ext/hash/indifferent_access"
|
|
4
4
|
require "active_support/core_ext/array/wrap"
|
5
5
|
require "active_support/core_ext/string/filters"
|
6
6
|
require "active_support/core_ext/object/to_query"
|
7
|
+
require "active_support/deep_mergeable"
|
7
8
|
require "action_dispatch/http/upload"
|
8
9
|
require "rack/test"
|
9
10
|
require "stringio"
|
@@ -137,6 +138,8 @@ module ActionController
|
|
137
138
|
# params[:key] # => "value"
|
138
139
|
# params["key"] # => "value"
|
139
140
|
class Parameters
|
141
|
+
include ActiveSupport::DeepMergeable
|
142
|
+
|
140
143
|
cattr_accessor :permit_all_parameters, instance_accessor: false, default: false
|
141
144
|
|
142
145
|
cattr_accessor :action_on_unpermitted_parameters, instance_accessor: false
|
@@ -853,13 +856,41 @@ module ActionController
|
|
853
856
|
)
|
854
857
|
end
|
855
858
|
|
859
|
+
##
|
860
|
+
# :call-seq: merge!(other_hash)
|
861
|
+
#
|
856
862
|
# Returns the current +ActionController::Parameters+ instance with
|
857
863
|
# +other_hash+ merged into current hash.
|
858
|
-
def merge!(other_hash)
|
859
|
-
@parameters.merge!(other_hash.to_h)
|
864
|
+
def merge!(other_hash, &block)
|
865
|
+
@parameters.merge!(other_hash.to_h, &block)
|
860
866
|
self
|
861
867
|
end
|
862
868
|
|
869
|
+
##
|
870
|
+
# :method: deep_merge
|
871
|
+
# :call-seq: deep_merge(other_hash, &block)
|
872
|
+
#
|
873
|
+
# Returns a new +ActionController::Parameters+ instance with +self+ and +other_hash+ merged recursively.
|
874
|
+
#
|
875
|
+
# Like with +Hash#merge+ in the standard library, a block can be provided
|
876
|
+
# to merge values.
|
877
|
+
#
|
878
|
+
#--
|
879
|
+
# Implemented by ActiveSupport::DeepMergeable#deep_merge.
|
880
|
+
|
881
|
+
##
|
882
|
+
# :method: deep_merge!
|
883
|
+
# :call-seq: deep_merge!(other_hash, &block)
|
884
|
+
#
|
885
|
+
# Same as +#deep_merge+, but modifies +self+.
|
886
|
+
#
|
887
|
+
#--
|
888
|
+
# Implemented by ActiveSupport::DeepMergeable#deep_merge!.
|
889
|
+
|
890
|
+
def deep_merge?(other_hash) # :nodoc
|
891
|
+
other_hash.is_a?(ActiveSupport::DeepMergeable)
|
892
|
+
end
|
893
|
+
|
863
894
|
# Returns a new +ActionController::Parameters+ instance with all keys
|
864
895
|
# from current hash merged into +other_hash+.
|
865
896
|
def reverse_merge(other_hash)
|
@@ -29,7 +29,7 @@ module ActionDispatch
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def serve(req)
|
32
|
-
find_routes(req)
|
32
|
+
find_routes(req) do |match, parameters, route|
|
33
33
|
set_params = req.path_parameters
|
34
34
|
path_info = req.path_info
|
35
35
|
script_name = req.script_name
|
@@ -64,7 +64,7 @@ module ActionDispatch
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def recognize(rails_req)
|
67
|
-
find_routes(rails_req)
|
67
|
+
find_routes(rails_req) do |match, parameters, route|
|
68
68
|
unless route.path.anchored
|
69
69
|
rails_req.script_name = match.to_s
|
70
70
|
rails_req.path_info = match.post_match
|
@@ -121,14 +121,14 @@ module ActionDispatch
|
|
121
121
|
|
122
122
|
routes.sort_by!(&:precedence)
|
123
123
|
|
124
|
-
routes.
|
124
|
+
routes.each { |r|
|
125
125
|
match_data = r.path.match(path_info)
|
126
126
|
path_parameters = {}
|
127
127
|
match_data.names.each_with_index { |name, i|
|
128
128
|
val = match_data[i + 1]
|
129
129
|
path_parameters[name.to_sym] = Utils.unescape_uri(val) if val
|
130
130
|
}
|
131
|
-
[match_data, path_parameters, r]
|
131
|
+
yield [match_data, path_parameters, r]
|
132
132
|
}
|
133
133
|
end
|
134
134
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.1.0.
|
4
|
+
version: 7.1.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.1.0.
|
19
|
+
version: 7.1.0.rc1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 7.1.0.
|
26
|
+
version: 7.1.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,28 +114,28 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 7.1.0.
|
117
|
+
version: 7.1.0.rc1
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 7.1.0.
|
124
|
+
version: 7.1.0.rc1
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: activemodel
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 7.1.0.
|
131
|
+
version: 7.1.0.rc1
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 7.1.0.
|
138
|
+
version: 7.1.0.rc1
|
139
139
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
140
140
|
testing MVC web applications. Works with any Rack-compatible server.
|
141
141
|
email: david@loudthinking.com
|
@@ -332,10 +332,10 @@ licenses:
|
|
332
332
|
- MIT
|
333
333
|
metadata:
|
334
334
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
335
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.1.0.
|
336
|
-
documentation_uri: https://api.rubyonrails.org/v7.1.0.
|
335
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.1.0.rc1/actionpack/CHANGELOG.md
|
336
|
+
documentation_uri: https://api.rubyonrails.org/v7.1.0.rc1/
|
337
337
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
338
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.1.0.
|
338
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.1.0.rc1/actionpack
|
339
339
|
rubygems_mfa_required: 'true'
|
340
340
|
post_install_message:
|
341
341
|
rdoc_options: []
|