mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Brought back reloading of models
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
95454bfb33
commit
0942bfa7a9
2 changed files with 7 additions and 1 deletions
|
@ -29,6 +29,12 @@ module Dependencies
|
|||
self.loaded = [ ]
|
||||
end
|
||||
|
||||
def reload
|
||||
old_loaded = loaded.dup
|
||||
clear
|
||||
old_loaded.each { |file_name| depend_on(file_name, true) }
|
||||
end
|
||||
|
||||
private
|
||||
def require_or_load(file_name)
|
||||
mechanism == :load ? silence_warnings { load("#{file_name}.rb") } : require(file_name)
|
||||
|
|
|
@ -51,7 +51,7 @@ class Dispatcher
|
|||
begin
|
||||
remove_class_hierarchy(controller_class(controller_name), ActionController::Base)
|
||||
ActiveRecord::Base.reset_column_information_and_inheritable_attributes_for_all_subclasses
|
||||
Dependencies.clear
|
||||
Dependencies.reload
|
||||
rescue Object => exception
|
||||
# Compilation errors are caught on the first run through
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue