diff options
author | Łukasz Strzałkowski <lukasz.strzalkowski@gmail.com> | 2012-05-18 23:21:20 +0200 |
---|---|---|
committer | Łukasz Strzałkowski <lukasz.strzalkowski@gmail.com> | 2012-05-18 23:55:39 +0200 |
commit | 5f7bfb77786ab02db213f9563c199fc5b7f53f3e (patch) | |
tree | cea3442789306f3f3e0ce225c9a98c8ddc1a7225 /railties/lib/rails/application | |
parent | 61fc10d23382c7ba57c67391063a2113fb3f2abc (diff) | |
download | rails-5f7bfb77786ab02db213f9563c199fc5b7f53f3e.tar.gz rails-5f7bfb77786ab02db213f9563c199fc5b7f53f3e.tar.bz2 rails-5f7bfb77786ab02db213f9563c199fc5b7f53f3e.zip |
Fix inspecting route redirections, closes #6369
This commit fixes route inspection in `rake routes`
Before:
foo /foo(.:format) :controller#:action"
After:
foo /foo(.:format) Redirect (301)
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r-- | railties/lib/rails/application/route_inspector.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/rails/application/route_inspector.rb b/railties/lib/rails/application/route_inspector.rb index 1e5ce67a58..845c54f416 100644 --- a/railties/lib/rails/application/route_inspector.rb +++ b/railties/lib/rails/application/route_inspector.rb @@ -16,7 +16,7 @@ module Rails class_name = app.class.name.to_s if class_name == "ActionDispatch::Routing::Mapper::Constraints" rack_app(app.app) - elsif class_name !~ /^ActionDispatch::Routing/ + elsif class_name == "ActionDispatch::Routing::Redirect" || class_name !~ /^ActionDispatch::Routing/ app end end @@ -67,7 +67,7 @@ module Rails @engines = Hash.new end - def format all_routes, filter = nil + def format(all_routes, filter = nil) if filter all_routes = all_routes.select{ |route| route.defaults[:controller] == filter } end |