Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add LoadingModule.clear! back temporarily

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3524 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 6d7b0374d12de2ddeaa9c3f896234111ed6bf8e2 1 parent 1129e5b
@seckar seckar authored
View
8 activesupport/lib/active_support/dependencies.rb
@@ -142,6 +142,14 @@ def const_load!(name, file_name = nil)
def const_available?(name)
self.const_defined?(name) || load_paths.any? {|lp| lp.filesystem_path(path + [name])}
end
+
+ # Erase all items in this module
+ def clear!
+ constants.each do |name|
+ Object.send(:remove_const, name) if Object.const_defined?(name) && Object.const_get(name).object_id == self.const_get(name).object_id
+ self.send(:remove_const, name)
+ end
+ end
end
class RootLoadingModule < LoadingModule #:nodoc:
View
1  railties/lib/dispatcher.rb
@@ -50,6 +50,7 @@ def dispatch(cgi = nil, session_options = ActionController::CgiRequest::DEFAULT_
# mailers, and so forth. This allows them to be loaded again without having
# to restart the server (WEBrick, FastCGI, etc.).
def reset_application!
+ Controllers.clear!
Dependencies.clear
ActiveRecord::Base.reset_subclasses
Class.remove_class(*Reloadable.reloadable_classes)
Please sign in to comment.
Something went wrong with that request. Please try again.