未验证 提交 3809e3e5 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #35858 from localhostdotdev/add-extensions-to-arity-error-message

Fix arity warning for template handlers
......@@ -45,12 +45,12 @@ def register_template_handler(*extensions, handler)
unless params.find_all { |type, _| type == :req || type == :opt }.length >= 2
ActiveSupport::Deprecation.warn <<~eowarn
Single arity template handlers are deprecated. Template handlers must
Single arity template handlers are deprecated. Template handlers must
now accept two parameters, the view object and the source for the view object.
Change:
>> #{handler.class}#call(#{params.map(&:last).join(", ")})
>> #{handler}.call(#{params.map(&:last).join(", ")})
To:
>> #{handler.class}#call(#{params.map(&:last).join(", ")}, source)
>> #{handler}.call(#{params.map(&:last).join(", ")}, source)
eowarn
handler = LegacyHandlerWrapper.new(handler)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册