diff options
author | Lucas Mazza <lucastmazza@gmail.com> | 2014-08-17 22:36:22 -0300 |
---|---|---|
committer | Lucas Mazza <lucastmazza@gmail.com> | 2014-08-17 22:36:22 -0300 |
commit | 9ee64f07f7306331b0643bafc21fd5321c844e39 (patch) | |
tree | 88e9e90cface6b75ddcb8f93be1960969e13a7e9 /actionpack/lib/action_dispatch/routing | |
parent | 6e6ebeb03cf0ff58c9ef778bfbdd9b0b9891b17b (diff) | |
download | rails-9ee64f07f7306331b0643bafc21fd5321c844e39.tar.gz rails-9ee64f07f7306331b0643bafc21fd5321c844e39.tar.bz2 rails-9ee64f07f7306331b0643bafc21fd5321c844e39.zip |
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.
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 5 |
1 files changed, 5 insertions, 0 deletions
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 |