Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Brought back reloading of models

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@478 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 0942bfa7a96e981bf146dee1ad32fa81e68ee6e6 1 parent 95454bf
@dhh dhh authored
View
6 activesupport/lib/dependencies.rb
@@ -29,6 +29,12 @@ def clear
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)
View
2  railties/lib/dispatcher.rb
@@ -51,7 +51,7 @@ def reset_application(controller_name)
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
Please sign in to comment.
Something went wrong with that request. Please try again.