Remove deprecated support for passing `:path` and route path as stings in...

Remove deprecated support for passing `:path` and route path as stings in `ActionDispatch::Routing::Mapper#match`
上级 5860b354
* Remove deprecated support passing path as `nil` in `ActionDispatch::Routing::Mapper#match`.
* Remove deprecated support for passing `:path` and route path as stings in `ActionDispatch::Routing::Mapper#match`.
*Rafael Mendonça França*
* Remove deprecated support for passing path as `nil` in `ActionDispatch::Routing::Mapper#match`.
*Rafael Mendonça França*
......
......@@ -1840,18 +1840,7 @@ def map_match(paths, options)
path_types.fetch(String, []).each do |_path|
route_options = options.dup
if _path && option_path
ActiveSupport::Deprecation.warn <<-eowarn
Specifying strings for both :path and the route path is deprecated. Change things like this:
match #{_path.inspect}, :path => #{option_path.inspect}
to this:
match #{option_path.inspect}, :as => #{_path.inspect}, :action => #{_path.inspect}
eowarn
route_options[:action] = _path
route_options[:as] = _path
_path = option_path
raise ArgumentError, "Ambigous route definition. Both :path and the route path where specified as strings."
end
to = get_to_from_path(_path, to, route_options[:action])
decomposed_match(_path, controller, route_options, _path, to, via, formatted, anchor, options_constraints)
......
......@@ -364,12 +364,9 @@ def test_bookmarks
end
def test_pagemarks
tc = self
draw do
scope "pagemark", controller: "pagemarks", as: :pagemark do
tc.assert_deprecated do
get "new", path: "build"
end
get "build", action: "new", as: "new"
post "create", as: ""
put "update"
get "remove", action: :destroy, as: :remove
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册