mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Add LoadingModule.clear! back temporarily
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3524 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -142,6 +142,14 @@ module Dependencies #:nodoc:
|
||||
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:
|
||||
|
||||
@@ -50,6 +50,7 @@ class Dispatcher
|
||||
# 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)
|
||||
|
||||
Reference in New Issue
Block a user