aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-03-02 00:03:11 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-03-02 00:03:11 +0000
commit654370d9ad7a66f3dd9a66da78b888ab79ea0ae7 (patch)
treec7acddf47248415065c6e1d1466e143ddc617d16
parent02ba03509c6a0f3e0fde99f0172a0125c83e43ce (diff)
downloadrails-654370d9ad7a66f3dd9a66da78b888ab79ea0ae7.tar.gz
rails-654370d9ad7a66f3dd9a66da78b888ab79ea0ae7.tar.bz2
rails-654370d9ad7a66f3dd9a66da78b888ab79ea0ae7.zip
Fixed that RAILS_ROOT might not be defined when AP was loaded, so do a late initialization of the ROUTE_FILE #761 [Scott Barron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@822 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/CHANGELOG6
-rw-r--r--actionpack/lib/action_controller/routing.rb5
2 files changed, 8 insertions, 3 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index dbfb4b6b30..c9b47db755 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,11 @@
*SVN*
+* Fixed that RAILS_ROOT might not be defined when AP was loaded, so do a late initialization of the ROUTE_FILE #761 [Scott Barron]
+
+* Fix request.path_info and clear up LoadingModule behavior #754 [Nicholas Seckar]
+
+* Fixed caching to be aware of extensions (so you can cache files like api.wsdl or logo.png) #734 [Nicholas Seckar]
+
* Fixed that Routes would raise NameErrors if a controller component contains characters that are not valid constant names #733 [Nicholas Seckar]
* Added PATH_INFO access from the request that allows urls like the following to be interpreted by rails: http://www.example.com/dispatcher.cgi/controller/action -- that makes it possible to use rails as a CGI under lighttpd and would also allow (for example) Rublog to be ported to rails without breaking existing links to Rublog-powered blogs. #728 [Jamis Buck]
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: