Skip to content

Commit

Permalink
Change session restoration to allow namespaced models to be autoloaded.
Browse files Browse the repository at this point in the history
Closes #6348.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6054 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
seckar committed Jan 28, 2007
1 parent 35ec1c9 commit b7df916
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions actionpack/CHANGELOG
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
5 changes: 3 additions & 2 deletions actionpack/lib/action_controller/cgi_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,10 @@ def new_session
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.
Expand Down

0 comments on commit b7df916

Please sign in to comment.