Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5101 from ckdake/ckdake_actionview_handler_reset

Reset memoized hash keys when new ActionView::Template handler is registered
Conflicts:

	actionpack/lib/action_view/template/handlers.rb
  • Loading branch information...
commit 5e3b54d25aeb84c4d6806416fbd6c21c29564d6a 1 parent 07dc909
José Valim josevalim authored
1  actionpack/lib/action_view/template/handlers.rb
View
@@ -23,6 +23,7 @@ def self.extensions
# and should return the rendered template as a String.
def register_template_handler(extension, handler)
@@template_handlers[extension.to_sym] = handler
+ @@template_extensions = nil
end
def template_handler_extensions
6 actionpack/test/template/render_test.rb
View
@@ -299,6 +299,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.