Skip to content

Commit

Permalink
Clear the filters when the routes get cleared so we don't end up with…
Browse files Browse the repository at this point in the history
… multiple filters (in particular in development mode when the routes get cleared every request)

Signed-off-by: Sven Fuchs <svenfuchs@artweb-design.de>
  • Loading branch information
mattenat authored and Sven Fuchs committed Apr 1, 2009
1 parent 9f73f4d commit 2998091
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/routing_filter.rb
Expand Up @@ -37,6 +37,13 @@ def generate_optimisation_block_with_filtering(*args)
end

ActionController::Routing::RouteSet.class_eval do
def clear_with_filtering!
returning clear_without_filtering! do
@filters.clear if @filters
end
end
alias_method_chain :clear!, :filtering

def filters
@filters ||= RoutingFilter::Chain.new
end
Expand Down Expand Up @@ -66,4 +73,4 @@ def extract_request_environment(request)
:subdomain => request.subdomains.first
end
end
end
end

0 comments on commit 2998091

Please sign in to comment.