Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
540a0ba8
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
540a0ba8
编写于
7月 04, 2014
作者:
R
Rafael Mendonça França
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #16013 from tgxworld/remove_symbolized_path_parameters
Remove symbolized_path_parameters.
上级
c59c0912
cb5f2d32
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
10 addition
and
10 deletion
+10
-10
actionpack/lib/action_controller/test_case.rb
actionpack/lib/action_controller/test_case.rb
+0
-1
actionpack/lib/action_dispatch/http/parameters.rb
actionpack/lib/action_dispatch/http/parameters.rb
+4
-3
actionpack/lib/action_dispatch/testing/test_request.rb
actionpack/lib/action_dispatch/testing/test_request.rb
+1
-1
actionpack/test/controller/test_case_test.rb
actionpack/test/controller/test_case_test.rb
+3
-3
actionpack/test/dispatch/routing_test.rb
actionpack/test/dispatch/routing_test.rb
+2
-2
未找到文件。
actionpack/lib/action_controller/test_case.rb
浏览文件 @
540a0ba8
...
...
@@ -233,7 +233,6 @@ def recycle!
@formats
=
nil
@env
.
delete_if
{
|
k
,
v
|
k
=~
/^(action_dispatch|rack)\.request/
}
@env
.
delete_if
{
|
k
,
v
|
k
=~
/^action_dispatch\.rescue/
}
@symbolized_path_params
=
nil
@method
=
@request_method
=
nil
@fullpath
=
@ip
=
@remote_ip
=
@protocol
=
nil
@env
[
'action_dispatch.request.query_parameters'
]
=
{}
...
...
actionpack/lib/action_dispatch/http/parameters.rb
浏览文件 @
540a0ba8
require
'active_support/core_ext/hash/keys'
require
'active_support/core_ext/hash/indifferent_access'
require
'active_support/deprecation'
module
ActionDispatch
module
Http
...
...
@@ -24,8 +25,10 @@ def path_parameters=(parameters) #:nodoc:
@env
[
PARAMETERS_KEY
]
=
parameters
end
# The same as <tt>path_parameters</tt> with explicitly symbolized keys.
def
symbolized_path_parameters
ActiveSupport
::
Deprecation
.
warn
(
"`symbolized_path_parameters` is deprecated. Please use `path_parameters`"
)
path_parameters
end
...
...
@@ -33,8 +36,6 @@ def symbolized_path_parameters
# Returned hash keys are strings:
#
# {'action' => 'my_action', 'controller' => 'my_controller'}
#
# See <tt>symbolized_path_parameters</tt> for symbolized keys.
def
path_parameters
@env
[
PARAMETERS_KEY
]
||=
{}
end
...
...
actionpack/lib/action_dispatch/testing/test_request.rb
浏览文件 @
540a0ba8
...
...
@@ -39,7 +39,7 @@ def path=(path)
end
def
action
=
(
action_name
)
path_parameters
[
"action"
]
=
action_name
.
to_s
path_parameters
[
:action
]
=
action_name
.
to_s
end
def
if_modified_since
=
(
last_modified
)
...
...
actionpack/test/controller/test_case_test.rb
浏览文件 @
540a0ba8
...
...
@@ -737,12 +737,12 @@ def test_filtered_parameters_reset_between_requests
assert_equal
"baz"
,
@request
.
filtered_parameters
[
:foo
]
end
def
test_
symbolized_
path_params_reset_after_request
def
test_path_params_reset_after_request
get
:test_params
,
:id
=>
"foo"
assert_equal
"foo"
,
@request
.
symbolized_
path_parameters
[
:id
]
assert_equal
"foo"
,
@request
.
path_parameters
[
:id
]
@request
.
recycle!
get
:test_params
assert_nil
@request
.
symbolized_
path_parameters
[
:id
]
assert_nil
@request
.
path_parameters
[
:id
]
end
def
test_request_protocol_is_reset_after_request
...
...
actionpack/test/dispatch/routing_test.rb
浏览文件 @
540a0ba8
...
...
@@ -2831,7 +2831,7 @@ def test_redirect_https
end
end
def
test_
symbolized_
path_parameters_is_not_stale
def
test_path_parameters_is_not_stale
draw
do
scope
'/countries/:country'
,
:constraints
=>
lambda
{
|
params
,
req
|
%w(all France)
.
include?
(
params
[
:country
])
}
do
get
'/'
,
:to
=>
'countries#index'
...
...
@@ -3148,7 +3148,7 @@ def test_multiple_positional_args_with_the_same_name
get
'/downloads/1/1.tar'
assert_equal
'downloads#show'
,
@response
.
body
assert_equal
expected_params
,
@request
.
symbolized_
path_parameters
assert_equal
expected_params
,
@request
.
path_parameters
assert_equal
'/downloads/1/1.tar'
,
download_path
(
'1'
)
assert_equal
'/downloads/1/1.tar'
,
download_path
(
'1'
,
'1'
)
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录