actionpack 5.1.2 → 5.1.3.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 +9 -0
- data/lib/action_controller/metal/params_wrapper.rb +1 -1
- data/lib/action_controller/metal/strong_parameters.rb +8 -1
- data/lib/action_controller/railtie.rb +9 -7
- data/lib/action_dispatch/request/utils.rb +1 -1
- data/lib/action_dispatch/routing/mapper.rb +13 -6
- data/lib/action_dispatch/routing/route_set.rb +4 -2
- data/lib/action_dispatch/routing/routes_proxy.rb +5 -2
- data/lib/action_dispatch/system_testing/driver.rb +3 -3
- data/lib/action_dispatch/testing/integration.rb +1 -2
- data/lib/action_pack/gem_version.rb +2 -2
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebb4cff7e815dc558be31f6bde9c09189d2c4d3e
|
4
|
+
data.tar.gz: b65b7b309ec1899127650936e4213ca313fee55d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c99db076703a8fed396d063202cf6501afaca25fb33e8b4e415ef010cec2bb5edc36fce5790a9754bfaba66ffe1454608c4c58e146210d270ea3ccd6349a2dee
|
7
|
+
data.tar.gz: c158dd8319e7c9d96ec741fe2c55af255e921f847d5bed04178f8d4d8c9dc5285856b70ee57cbbda87d6d33862249b1a4bdda7c7df5491c872006073c745f17e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
|
+
## Rails 5.1.3.rc1 (July 19, 2017) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
1
6
|
## Rails 5.1.2 (June 26, 2017) ##
|
2
7
|
|
8
|
+
* Fallback `ActionController::Parameters#to_s` to `Hash#to_s`.
|
9
|
+
|
10
|
+
*Kir Shatrov*
|
11
|
+
|
3
12
|
* `driven_by` now registers poltergeist and capybara-webkit
|
4
13
|
|
5
14
|
If driver poltergeist or capybara-webkit is set for System Tests,
|
@@ -283,7 +283,7 @@ module ActionController
|
|
283
283
|
return false unless request.has_content_type?
|
284
284
|
|
285
285
|
ref = request.content_mime_type.ref
|
286
|
-
_wrapper_formats.include?(ref) && _wrapper_key && !request.request_parameters
|
286
|
+
_wrapper_formats.include?(ref) && _wrapper_key && !request.request_parameters.key?(_wrapper_key)
|
287
287
|
end
|
288
288
|
end
|
289
289
|
end
|
@@ -180,6 +180,13 @@ module ActionController
|
|
180
180
|
#
|
181
181
|
# Returns a new array of the keys of the parameters.
|
182
182
|
|
183
|
+
##
|
184
|
+
# :method: to_s
|
185
|
+
#
|
186
|
+
# :call-seq:
|
187
|
+
# to_s()
|
188
|
+
# Returns the content of the parameters as a string.
|
189
|
+
|
183
190
|
##
|
184
191
|
# :method: value?
|
185
192
|
#
|
@@ -196,7 +203,7 @@ module ActionController
|
|
196
203
|
#
|
197
204
|
# Returns a new array of the values of the parameters.
|
198
205
|
delegate :keys, :key?, :has_key?, :values, :has_value?, :value?, :empty?, :include?,
|
199
|
-
:as_json, to: :@parameters
|
206
|
+
:as_json, :to_s, to: :@parameters
|
200
207
|
|
201
208
|
# By default, never raise an UnpermittedParameters exception if these
|
202
209
|
# params are present. The default includes both 'controller' and 'action'
|
@@ -26,13 +26,15 @@ module ActionController
|
|
26
26
|
ActiveSupport::Deprecation.warn("raise_on_unfiltered_parameters is deprecated and has no effect in Rails 5.1.")
|
27
27
|
end
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
29
|
+
ActiveSupport.on_load(:action_controller) do
|
30
|
+
ActionController::Parameters.permit_all_parameters = options.delete(:permit_all_parameters) { false }
|
31
|
+
if app.config.action_controller[:always_permitted_parameters]
|
32
|
+
ActionController::Parameters.always_permitted_parameters =
|
33
|
+
app.config.action_controller.delete(:always_permitted_parameters)
|
34
|
+
end
|
35
|
+
ActionController::Parameters.action_on_unpermitted_parameters = options.delete(:action_on_unpermitted_parameters) do
|
36
|
+
(Rails.env.test? || Rails.env.development?) ? :log : false
|
37
|
+
end
|
36
38
|
end
|
37
39
|
end
|
38
40
|
|
@@ -33,7 +33,7 @@ module ActionDispatch
|
|
33
33
|
unless params.valid_encoding?
|
34
34
|
# Raise Rack::Utils::InvalidParameterError for consistency with Rack.
|
35
35
|
# ActionDispatch::Request#GET will re-raise as a BadRequest error.
|
36
|
-
raise Rack::Utils::InvalidParameterError, "
|
36
|
+
raise Rack::Utils::InvalidParameterError, "Invalid encoding for parameter: #{params.scrub}"
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -652,18 +652,25 @@ module ActionDispatch
|
|
652
652
|
def define_generate_prefix(app, name)
|
653
653
|
_route = @set.named_routes.get name
|
654
654
|
_routes = @set
|
655
|
-
|
655
|
+
|
656
|
+
script_namer = ->(options) do
|
657
|
+
prefix_options = options.slice(*_route.segment_keys)
|
658
|
+
prefix_options[:relative_url_root] = "".freeze
|
659
|
+
# We must actually delete prefix segment keys to avoid passing them to next url_for.
|
660
|
+
_route.segment_keys.each { |k| options.delete(k) }
|
661
|
+
_routes.url_helpers.send("#{name}_path", prefix_options)
|
662
|
+
end
|
663
|
+
|
664
|
+
app.routes.define_mounted_helper(name, script_namer)
|
665
|
+
|
656
666
|
app.routes.extend Module.new {
|
657
667
|
def optimize_routes_generation?; false; end
|
668
|
+
|
658
669
|
define_method :find_script_name do |options|
|
659
670
|
if options.key? :script_name
|
660
671
|
super(options)
|
661
672
|
else
|
662
|
-
|
663
|
-
prefix_options[:relative_url_root] = "".freeze
|
664
|
-
# we must actually delete prefix segment keys to avoid passing them to next url_for
|
665
|
-
_route.segment_keys.each { |k| options.delete(k) }
|
666
|
-
_routes.url_helpers.send("#{name}_path", prefix_options)
|
673
|
+
script_namer.call(options)
|
667
674
|
end
|
668
675
|
end
|
669
676
|
}
|
@@ -279,6 +279,8 @@ module ActionDispatch
|
|
279
279
|
if args.size < path_params_size
|
280
280
|
path_params -= controller_options.keys
|
281
281
|
path_params -= result.keys
|
282
|
+
else
|
283
|
+
path_params = path_params.dup
|
282
284
|
end
|
283
285
|
inner_options.each_key do |key|
|
284
286
|
path_params.delete(key)
|
@@ -454,7 +456,7 @@ module ActionDispatch
|
|
454
456
|
MountedHelpers
|
455
457
|
end
|
456
458
|
|
457
|
-
def define_mounted_helper(name)
|
459
|
+
def define_mounted_helper(name, script_namer = nil)
|
458
460
|
return if MountedHelpers.method_defined?(name)
|
459
461
|
|
460
462
|
routes = self
|
@@ -462,7 +464,7 @@ module ActionDispatch
|
|
462
464
|
|
463
465
|
MountedHelpers.class_eval do
|
464
466
|
define_method "_#{name}" do
|
465
|
-
RoutesProxy.new(routes, _routes_context, helpers)
|
467
|
+
RoutesProxy.new(routes, _routes_context, helpers, script_namer)
|
466
468
|
end
|
467
469
|
end
|
468
470
|
|
@@ -8,9 +8,10 @@ module ActionDispatch
|
|
8
8
|
attr_accessor :scope, :routes
|
9
9
|
alias :_routes :routes
|
10
10
|
|
11
|
-
def initialize(routes, scope, helpers)
|
11
|
+
def initialize(routes, scope, helpers, script_namer = nil)
|
12
12
|
@routes, @scope = routes, scope
|
13
13
|
@helpers = helpers
|
14
|
+
@script_namer = script_namer
|
14
15
|
end
|
15
16
|
|
16
17
|
def url_options
|
@@ -28,7 +29,9 @@ module ActionDispatch
|
|
28
29
|
self.class.class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
29
30
|
def #{method}(*args)
|
30
31
|
options = args.extract_options!
|
31
|
-
|
32
|
+
options = url_options.merge((options || {}).symbolize_keys)
|
33
|
+
options.reverse_merge!(script_name: @script_namer.call(options)) if @script_namer
|
34
|
+
args << options
|
32
35
|
@helpers.#{method}(*args)
|
33
36
|
end
|
34
37
|
RUBY
|
@@ -9,14 +9,14 @@ module ActionDispatch
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def use
|
12
|
-
register
|
12
|
+
register if registerable?
|
13
13
|
|
14
14
|
setup
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
18
|
-
def
|
19
|
-
|
18
|
+
def registerable?
|
19
|
+
[:selenium, :poltergeist, :webkit].include?(@name)
|
20
20
|
end
|
21
21
|
|
22
22
|
def register
|
@@ -338,8 +338,7 @@ module ActionDispatch
|
|
338
338
|
@integration_session = nil
|
339
339
|
end
|
340
340
|
|
341
|
-
%w(get post patch put head delete cookies assigns
|
342
|
-
xml_http_request xhr get_via_redirect post_via_redirect).each do |method|
|
341
|
+
%w(get post patch put head delete cookies assigns follow_redirect!).each do |method|
|
343
342
|
define_method(method) do |*args|
|
344
343
|
# reset the html_document variable, except for cookies/assigns calls
|
345
344
|
unless method == "cookies" || method == "assigns"
|
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: 5.1.
|
4
|
+
version: 5.1.3.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: 2017-
|
11
|
+
date: 2017-07-19 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: 5.1.
|
19
|
+
version: 5.1.3.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: 5.1.
|
26
|
+
version: 5.1.3.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,28 +92,28 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - '='
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 5.1.
|
95
|
+
version: 5.1.3.rc1
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - '='
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 5.1.
|
102
|
+
version: 5.1.3.rc1
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: activemodel
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - '='
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 5.1.
|
109
|
+
version: 5.1.3.rc1
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - '='
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: 5.1.
|
116
|
+
version: 5.1.3.rc1
|
117
117
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
118
118
|
testing MVC web applications. Works with any Rack-compatible server.
|
119
119
|
email: david@loudthinking.com
|
@@ -298,9 +298,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
298
298
|
version: 2.2.2
|
299
299
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
300
300
|
requirements:
|
301
|
-
- - "
|
301
|
+
- - ">"
|
302
302
|
- !ruby/object:Gem::Version
|
303
|
-
version:
|
303
|
+
version: 1.3.1
|
304
304
|
requirements:
|
305
305
|
- none
|
306
306
|
rubyforge_project:
|