From 486e2e6419e95247c68d35c7fdd0fb11a032d785 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Wed, 11 Feb 2009 06:52:47 +0000 Subject: [PATCH] Always reload templates when perform_caching is false and never when allow_concurrency is true --- actionpack/lib/action_view/renderable.rb | 4 ++-- .../test/template/compiled_templates_test.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb index 16cdd01..17ed02a 100644 --- a/actionpack/lib/action_view/renderable.rb +++ b/actionpack/lib/action_view/renderable.rb @@ -112,12 +112,12 @@ module ActionView end def recompile!(render_symbol, local_assigns) - compiled_source(:reload) if compiled_at.nil? || compiled_at < mtime + compiled_source(:reload) if !cached? || compiled_at.nil? || compiled_at < mtime compile!(render_symbol, local_assigns) end def redefine?(render_symbol) - compiled_at && defined_at[render_symbol] && compiled_at > defined_at[render_symbol] + reloadable? && compiled_at && defined_at[render_symbol] && compiled_at > defined_at[render_symbol] end end end diff --git a/actionpack/test/template/compiled_templates_test.rb b/actionpack/test/template/compiled_templates_test.rb index 55fa346..8f5c5d0 100644 --- a/actionpack/test/template/compiled_templates_test.rb +++ b/actionpack/test/template/compiled_templates_test.rb @@ -62,6 +62,7 @@ class CompiledTemplatesTest < Test::Unit::TestCase with_caching(true) do with_reloading(true) do assert_equal "Hello world!", render(:file => "test/hello_world.erb") + sleep(1) # Need to sleep so that the timestamp actually changes modify_template "test/hello_world.erb", "Goodbye world!" do assert_equal "Goodbye world!", render(:file => "test/hello_world.erb") sleep(1) # Need to sleep so that the timestamp actually changes -- 1.5.4.5