aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/finisher.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-12 22:51:33 +0100
committerJosé Valim <jose.valim@gmail.com>2011-12-12 22:54:04 +0100
commitfa1d9a884c0d5b70c97442e3360ac98ca5fa4340 (patch)
treee39e017a9de2936a87f3b9ecf1d14b6febd0a8f1 /railties/lib/rails/application/finisher.rb
parent62cda03fa824ce1e1fc92aaee0367c29ade6a504 (diff)
downloadrails-fa1d9a884c0d5b70c97442e3360ac98ca5fa4340.tar.gz
rails-fa1d9a884c0d5b70c97442e3360ac98ca5fa4340.tar.bz2
rails-fa1d9a884c0d5b70c97442e3360ac98ca5fa4340.zip
Speed up development by only reloading classes if dependencies files changed.
This can be turned off by setting `config.reload_classes_only_on_change` to false. Extensions like Active Record should add their respective files like db/schema.rb and db/structure.sql to `config.watchable_files` if they want their changes to affect classes reloading. Thanks to https://github.com/paneq/active_reload and Pastorino for the inspiration. <3
Diffstat (limited to 'railties/lib/rails/application/finisher.rb')
-rw-r--r--railties/lib/rails/application/finisher.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb
index 17e7aa0f28..e000f6ef3a 100644
--- a/railties/lib/rails/application/finisher.rb
+++ b/railties/lib/rails/application/finisher.rb
@@ -5,7 +5,7 @@ module Rails
$rails_rake_task = nil
initializer :load_config_initializers do
- config.all_initializers.each { |init| load(init) }
+ config.initializers_paths.each { |init| load(init) }
end
initializer :add_generator_templates do
@@ -65,17 +65,17 @@ module Rails
end
# Set app reload just after the finisher hook to ensure
- # paths added in the hook are still loaded.
- initializer :set_dependencies_hook, :group => :all do |app|
- app.set_dependencies_hook
- end
-
- # Set app reload just after the finisher hook to ensure
# routes added in the hook are still loaded.
initializer :set_routes_reloader_hook do |app|
app.set_routes_reloader_hook
end
+ # Set app reload just after the finisher hook to ensure
+ # paths added in the hook are still loaded.
+ initializer :set_dependencies_hook, :group => :all do |app|
+ app.set_dependencies_hook
+ end
+
# Disable dependency loading during request cycle
initializer :disable_dependency_loading do
if config.cache_classes && !config.dependency_loading