aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/routing.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb
index ab568b6595..894b3476e1 100644
--- a/actionpack/lib/action_controller/routing.rb
+++ b/actionpack/lib/action_controller/routing.rb
@@ -1,8 +1,6 @@
module ActionController
# See http://manuals.rubyonrails.com/read/chapter/65
module Routing
- ROUTE_FILE = defined?(RAILS_ROOT) ? File.expand_path(File.join(RAILS_ROOT, 'config', 'routes')) : nil
-
class Route #:nodoc:
attr_reader :defaults # The defaults hash
@@ -282,7 +280,8 @@ module ActionController
def reload
begin
- require_dependency(ROUTE_FILE) if ROUTE_FILE
+ route_file = defined?(RAILS_ROOT) ? File.expand_path(File.join(RAILS_ROOT, 'config', 'routes')) : nil
+ require_dependency(route_file) if route_file
rescue LoadError, ScriptError => e
raise RoutingError, "Cannot load config/routes.rb:\n #{e.message}"
ensure # Ensure that there is at least one route: