diff options
Diffstat (limited to 'railties/lib')
-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) |