Tweak the Rails load order so observers are loaded after plugins, and reloaded in development mode. Closed #5279. [Rick Olson]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4684 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Rick Olson
2006-08-06 02:12:53 +00:00
parent e8f0b1ddd9
commit 26eefd79a4
3 changed files with 12 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
*SVN*
* Tweak the Rails load order so observers are loaded after plugins, and reloaded in development mode. Closed #5279. [Rick Olson]
* Added that you can change the web server port in config/lighttpd.conf from script/server --port/-p #5465 [mats@imediatec.co.uk]
* script/performance/profiler compatibility with the new ruby-prof, including an option to choose the results printer. #5679 [shugo@ruby-lang.org]

View File

@@ -54,7 +54,7 @@ class Dispatcher
# to restart the server (WEBrick, FastCGI, etc.).
def reset_application!
Dependencies.clear
ActiveRecord::Base.reset_subclasses
ActiveRecord::Base.reset
Class.remove_class(*Reloadable.reloadable_classes)
end

View File

@@ -67,6 +67,7 @@ module Rails
# * #initialize_framework_settings
# * #load_environment
# * #load_plugins
# * #load_observers
# * #initialize_routing
#
# (Note that #load_environment is invoked twice, once at the start and
@@ -89,7 +90,6 @@ module Rails
initialize_breakpoints
initialize_whiny_nils
initialize_temporary_directories
initialize_framework_settings
# Support for legacy configuration style where the environment
@@ -100,6 +100,9 @@ module Rails
add_support_load_paths
load_plugins
# Observers are loaded after plugins in case Observers or observed models are modified by plugins.
load_observers
# Routing must be initialized after plugins to allow the former to extend the routes
initialize_routing
@@ -171,7 +174,11 @@ module Rails
end
end
end
def load_observers
ActiveRecord::Base.instantiate_observers
end
# This initialization routine does nothing unless <tt>:active_record</tt>
# is one of the frameworks to load (Configuration#frameworks). If it is,
# this sets the database configuration from Configuration#database_configuration