aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2007-01-28 06:19:07 +0000
committerNicholas Seckar <nseckar@gmail.com>2007-01-28 06:19:07 +0000
commitb7df9162492383e2186762d85586b27ca120a1dd (patch)
tree779c6bccb5321ef59ec9c157c1179495dc17d610 /actionpack
parent35ec1c928f100f5b75bd2e6af63d26b10ba2282c (diff)
downloadrails-b7df9162492383e2186762d85586b27ca120a1dd.tar.gz
rails-b7df9162492383e2186762d85586b27ca120a1dd.tar.bz2
rails-b7df9162492383e2186762d85586b27ca120a1dd.zip
Change session restoration to allow namespaced models to be autoloaded. Closes #6348.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6054 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/cgi_process.rb5
2 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index fbf0f9811a..0819d3f9da 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Change session restoration to allow namespaced models to be autoloaded. Closes #6348. [Nicholas Seckar]
+
* Fix doubly appearing parameters due to string and symbol mixups. Closes #2551. [aeden]
* Fix overly greedy rescues when loading helpers. Fixes #6268. [Nicholas Seckar]
diff --git a/actionpack/lib/action_controller/cgi_process.rb b/actionpack/lib/action_controller/cgi_process.rb
index 49c5680f3f..8d24f8dd94 100644
--- a/actionpack/lib/action_controller/cgi_process.rb
+++ b/actionpack/lib/action_controller/cgi_process.rb
@@ -153,9 +153,10 @@ module ActionController #:nodoc:
def stale_session_check!
yield
rescue ArgumentError => argument_error
- if argument_error.message =~ %r{undefined class/module ([\w:]+)}
+ if argument_error.message =~ %r{undefined class/module ([\w:]*\w)}
begin
- Module.const_missing($1)
+ # Note that the regexp does not allow $1 to end with a ':'
+ $1.constantize
rescue LoadError, NameError => const_error
raise ActionController::SessionRestoreError, <<-end_msg
Session contains objects whose class definition isn\'t available.