diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-08-16 21:14:26 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-08-16 21:14:26 -0500 |
commit | 24ad9ae3d228acdf9aa31cf28bfe6dfb0139c247 (patch) | |
tree | 8328606506d2db378a35905a0953b59b0e84cfdf /actionpack/lib | |
parent | ccf28d2499d1b4e2aba41291eb800e0e02120923 (diff) | |
download | rails-24ad9ae3d228acdf9aa31cf28bfe6dfb0139c247.tar.gz rails-24ad9ae3d228acdf9aa31cf28bfe6dfb0139c247.tar.bz2 rails-24ad9ae3d228acdf9aa31cf28bfe6dfb0139c247.zip |
Cleanup route reloading in tests. Prefer with_routing over using ActionController::Routing::Routes directly
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/routing/route_set.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/routing/route_set.rb b/actionpack/lib/action_controller/routing/route_set.rb index a4f54ad662..25fdbf480e 100644 --- a/actionpack/lib/action_controller/routing/route_set.rb +++ b/actionpack/lib/action_controller/routing/route_set.rb @@ -213,7 +213,7 @@ module ActionController self.routes = [] self.named_routes = NamedRouteCollection.new - clear_recognize_optimized! + clear! end # Subclasses and plugins may override this method to specify a different @@ -223,6 +223,7 @@ module ActionController end def draw + clear! yield Mapper.new(self) install_helpers end @@ -230,8 +231,10 @@ module ActionController def clear! routes.clear named_routes.clear + @combined_regexp = nil @routes_by_controller = nil + # This will force routing/recognition_optimization.rb # to refresh optimisations. clear_recognize_optimized! @@ -262,7 +265,6 @@ module ActionController def load! Routing.use_controllers!(nil) # Clear the controller cache so we may discover new ones - clear! load_routes! end @@ -286,10 +288,12 @@ module ActionController configuration_files.each { |config| load(config) } @routes_last_modified = routes_changed_at else - add_route ":controller/:action/:id" + draw do |map| + map.connect ":controller/:action/:id" + end end end - + def routes_changed_at routes_changed_at = nil |