Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reset memoized hash keys when new entry added

  • Loading branch information...
commit 68d3a4619490a0d9df1951f38068bd06d9e0fbb9 1 parent 3b824d6
@ckdake ckdake authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.