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 /actionpack | |
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 'actionpack')
-rw-r--r-- | actionpack/test/dispatch/reloader_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/reloader_test.rb b/actionpack/test/dispatch/reloader_test.rb index bd24256427..3411bd14ea 100644 --- a/actionpack/test/dispatch/reloader_test.rb +++ b/actionpack/test/dispatch/reloader_test.rb @@ -129,6 +129,15 @@ class ReloaderTest < Test::Unit::TestCase assert cleaned end + def test_prepend_prepare_callback + i = 10 + Reloader.to_prepare { i += 1 } + Reloader.to_prepare(:prepend => true) { i = 0 } + + Reloader.prepare! + assert_equal 1, i + end + def test_cleanup_callbacks_are_called_on_exceptions cleaned = false Reloader.to_cleanup { cleaned = true } |