diff options
-rw-r--r-- | actionview/lib/action_view/template.rb | 3 | ||||
-rw-r--r-- | actionview/test/template/template_test.rb | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb index 94f8a194a0..1694e408c7 100644 --- a/actionview/lib/action_view/template.rb +++ b/actionview/lib/action_view/template.rb @@ -298,9 +298,6 @@ module ActionView compile(mod) end - # Just discard the source if we have a virtual path. This - # means we can get the template back. - @source = nil if @virtual_path @compiled = true end end diff --git a/actionview/test/template/template_test.rb b/actionview/test/template/template_test.rb index 71fb99115b..5ccddb3e9e 100644 --- a/actionview/test/template/template_test.rb +++ b/actionview/test/template/template_test.rb @@ -91,10 +91,10 @@ class TestERBTemplate < ActiveSupport::TestCase assert_equal "<%= hello %>", render end - def test_template_loses_its_source_after_rendering + def test_template_does_not_lose_its_source_after_rendering @template = new_template render - assert_nil @template.source + assert_equal "<%= hello %>", @template.source end def test_template_does_not_lose_its_source_after_rendering_if_it_does_not_have_a_virtual_path |