From 9ee64f07f7306331b0643bafc21fd5321c844e39 Mon Sep 17 00:00:00 2001 From: Lucas Mazza Date: Sun, 17 Aug 2014 22:36:22 -0300 Subject: Deprecate NamedRouteCollection#helpers. This method was removed at 210b338db20b1cdd0684f40bd78b52ed16148b99 but it is used by third party gems to check if a named route was defined. To help on the upgrade path on 4.2.0 we bring it back and emit a deprecation warning. --- actionpack/lib/action_dispatch/routing/route_set.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb') diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 5b3651aaee..f51bee3b31 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -101,6 +101,11 @@ module ActionDispatch @path_helpers.include?(key) || @url_helpers.include?(key) end + def helpers + ActiveSupport::Deprecation.warn("`named_routes.helpers` is deprecated, please use `route_defined?(route_name)` to see if a named route was defined.") + @path_helpers + @url_helpers + end + def helper_names @path_helpers.map(&:to_s) + @url_helpers.map(&:to_s) end -- cgit v1.2.3