Permalink
Browse files

Reset memoized hash keys when new entry added

  • Loading branch information...
1 parent 3b824d6 commit 68d3a4619490a0d9df1951f38068bd06d9e0fbb9 @ckdake ckdake committed Feb 20, 2012
Showing with 7 additions and 0 deletions.
  1. +1 −0 actionpack/lib/action_view/template/handlers.rb
  2. +6 −0 actionpack/test/template/render_test.rb
View
1 actionpack/lib/action_view/template/handlers.rb
@@ -26,6 +26,7 @@ def self.extensions
# return the rendered template as a string.
def register_template_handler(extension, klass)
@@template_handlers[extension.to_sym] = klass
+ @@template_extensions = nil
end
def template_handler_extensions
View
6 actionpack/test/template/render_test.rb
@@ -329,6 +329,12 @@ def test_render_inline_with_locals_and_compilable_custom_type
ActionView::Template.register_template_handler :foo, CustomHandler
assert_equal 'source: "Hello, <%= name %>!"', @view.render(:inline => "Hello, <%= name %>!", :locals => { :name => "Josh" }, :type => :foo)
end
+
+ def test_render_knows_about_types_registered_when_extensions_are_checked_earlier_in_initialization
+ ActionView::Template::Handlers.extensions
+ ActionView::Template.register_template_handler :foo, CustomHandler
+ assert ActionView::Template::Handlers.extensions.include?(:foo)
+ end
def test_render_ignores_templates_with_malformed_template_handlers
ActiveSupport::Deprecation.silence do

0 comments on commit 68d3a46

Please sign in to comment.