diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-12 22:51:33 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-12 22:54:04 +0100 |
commit | fa1d9a884c0d5b70c97442e3360ac98ca5fa4340 (patch) | |
tree | e39e017a9de2936a87f3b9ecf1d14b6febd0a8f1 /railties/lib/rails/application/finisher.rb | |
parent | 62cda03fa824ce1e1fc92aaee0367c29ade6a504 (diff) | |
download | rails-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.rb | 14 |
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 |