diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-08-09 16:52:42 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-08-09 16:52:42 +0000 |
commit | 651e57a72c2f53add43989c3aefa5ef843ed02a7 (patch) | |
tree | c7497fa77b5a498f28eee9d1055f7390a0a577d3 /railties/lib/dispatcher.rb | |
parent | 36dfeb9a3612cd62d30bb11efb5af9afdb0c9483 (diff) | |
download | rails-651e57a72c2f53add43989c3aefa5ef843ed02a7.tar.gz rails-651e57a72c2f53add43989c3aefa5ef843ed02a7.tar.bz2 rails-651e57a72c2f53add43989c3aefa5ef843ed02a7.zip |
Rearrange application resetting and preparation, fix bug with leaking subclasses hash in ActiveRecord::Base [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4742 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/dispatcher.rb')
-rw-r--r-- | railties/lib/dispatcher.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/dispatcher.rb b/railties/lib/dispatcher.rb index 2a882ae1b4..17e5ae74f7 100644 --- a/railties/lib/dispatcher.rb +++ b/railties/lib/dispatcher.rb @@ -54,9 +54,9 @@ 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! + ActiveRecord::Base.reset_subclasses if defined?(ActiveRecord) Dependencies.clear Class.remove_class(*Reloadable.reloadable_classes) - ActiveRecord::Base.reset if defined?(ActiveRecord) end @@ -159,3 +159,7 @@ class Dispatcher self.preparation_callbacks_run = false end + +Dispatcher.to_prepare :activerecord_instantiate_observers do + ActiveRecord::Base.instantiate_observers +end if defined?(ActiveRecord) |