aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-06-11 09:11:08 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-06-11 09:36:41 +0100
commitf728e57d2204a429f5282856ec89d4e047e72957 (patch)
treeaadaafc6e6ee750a8d380753a9f7e53aa71817f8 /actionpack/lib
parent3f594299c85ef111ac479b845fa8c7e37563ff66 (diff)
downloadrails-f728e57d2204a429f5282856ec89d4e047e72957.tar.gz
rails-f728e57d2204a429f5282856ec89d4e047e72957.tar.bz2
rails-f728e57d2204a429f5282856ec89d4e047e72957.zip
Make sure cache_template_loading works and don't use to_prepare callback
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/dispatcher.rb5
-rw-r--r--actionpack/lib/action_view/template.rb1
2 files changed, 2 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/dispatcher.rb b/actionpack/lib/action_controller/dispatcher.rb
index f20d9cc40f..fe4f6b4a7e 100644
--- a/actionpack/lib/action_controller/dispatcher.rb
+++ b/actionpack/lib/action_controller/dispatcher.rb
@@ -21,10 +21,6 @@ module ActionController
end
end
- to_prepare :reload_view_path_cache do
- ActionView::TemplateFinder.reload!
- end
-
if defined?(ActiveRecord)
before_dispatch { ActiveRecord::Base.verify_active_connections! }
to_prepare(:activerecord_instantiate_observers) { ActiveRecord::Base.instantiate_observers }
@@ -138,6 +134,7 @@ module ActionController
run_callbacks :prepare_dispatch
Routing::Routes.reload
+ ActionView::TemplateFinder.reload! unless ActionView::Base.cache_template_loading
end
# Cleanup the application by clearing out loaded classes so they can
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index a878ac66d9..25d5819af9 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -99,6 +99,7 @@ module ActionView #:nodoc:
# return the rendered template as a string.
def self.register_template_handler(extension, klass)
@@template_handlers[extension.to_sym] = klass
+ ActionView::TemplateFinder.reload!
end
def self.template_handler_extensions