From ba12ef6ae15208a608733a06b78940ef92f305b8 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 17 Apr 2013 11:36:08 -0700 Subject: just clear the caches on clear! rather than replacing. fixes #10251 --- actionpack/lib/action_dispatch/routing/route_set.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'actionpack/lib/action_dispatch/routing') diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index a993699e05..6e63f92ff3 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -97,9 +97,7 @@ module ActionDispatch @routes = {} @helpers = [] - @module = Module.new do - instance_methods.each { |selector| remove_method(selector) } - end + @module = Module.new end def helper_names @@ -108,13 +106,11 @@ module ActionDispatch def clear! @helpers.each do |helper| - @module.module_eval do - remove_possible_method helper - end + @module.remove_possible_method helper end - @routes = {} - @helpers = [] + @routes.clear + @helpers.clear end def add(name, route) -- cgit v1.2.3