提交 15702104 编写于 作者: J Jeremy Kemper 提交者: Yehuda Katz

Don't construct object deprecation proxy if unneeded

上级 31fb733b
......@@ -25,12 +25,11 @@ def render(view, local_assigns = {})
end
def render_partial(view, object = nil, local_assigns = {}, as = nil)
object ||= local_assigns[:object] ||
local_assigns[variable_name]
object ||= local_assigns[:object] || local_assigns[variable_name]
if view.respond_to?(:controller)
if object.nil? && view.respond_to?(:controller)
ivar = :"@#{variable_name}"
object ||=
object =
if view.controller.instance_variable_defined?(ivar)
ActiveSupport::Deprecation::DeprecatedObjectProxy.new(
view.controller.instance_variable_get(ivar),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册