From 01d3a36bfe5d56d85f8a36f2fe10ad96662b4530 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Fri, 14 Dec 2012 13:15:57 +0000 Subject: Clear url helper methods when routes are reloaded Remove all the old url helper methods when clear! is called on the route set because it's possible that some routes have been removed. --- actionpack/lib/action_dispatch/routing/route_set.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 61071d1228..c11e66d110 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -130,6 +130,12 @@ module ActionDispatch end def clear! + @helpers.each do |helper| + @module.module_eval do + remove_possible_method helper + end + end + @routes.clear @helpers.clear end -- cgit v1.2.3