From 9185b68cc652a113a85e29c8d6f7655f360cbedb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 28 Jul 2016 00:42:33 -0300 Subject: Remove deprecated support for passing `:path` and route path as stings in `ActionDispatch::Routing::Mapper#match` --- actionpack/CHANGELOG.md | 6 +++++- actionpack/lib/action_dispatch/routing/mapper.rb | 13 +------------ actionpack/test/dispatch/routing_test.rb | 5 +---- 3 files changed, 7 insertions(+), 17 deletions(-) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 8dba02a92c..c680e76f78 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,4 +1,8 @@ -* 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* diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 6db5ad8308..c481c190bf 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -1840,18 +1840,7 @@ module ActionDispatch 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) diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 74b764feb7..c01065932a 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -364,12 +364,9 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest 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 -- cgit v1.2.3