Permalink
Browse files

Restore the original path on Rails 3.2 (Issue #7)

  • Loading branch information...
1 parent 8b1b9f8 commit 6270eba04ee30e03500c8f977efe1189ede3f248 @mjonuschat mjonuschat committed May 8, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/routing_filter/adapters/routers/journey.rb
@@ -10,13 +10,16 @@ def filters
Journey::Router.class_eval do
def find_routes_with_filtering env
path, filter_parameters = env['PATH_INFO'], {}
+ original_path = path.dup
@routes.filters.run(:around_recognize, path, env) do
filter_parameters
end
find_routes_without_filtering(env).map do |match, parameters, route|
[ match, parameters.merge(filter_parameters), route ]
+ end.tap do |match, parameters, route|
+ env['PATH_INFO'] = original_path # restore the original path
end
end
alias_method_chain :find_routes, :filtering

0 comments on commit 6270eba

Please sign in to comment.