From 1a785645bab4726d8223a7542e4d908abc7678fc 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 --- actionpack/lib/action_view/renderable.rb | 2 +- .../test/template/compiled_templates_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb index 16cdd01..7e742be 100644 --- a/actionpack/lib/action_view/renderable.rb +++ b/actionpack/lib/action_view/renderable.rb @@ -112,7 +112,7 @@ 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 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