提交 5e3b54d2 编写于 作者: J José Valim

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
上级 07dc909a
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册