Dont load the target before the proxy has had a chance to answer the...

Dont load the target before the proxy has had a chance to answer the respond_to? -- this would cause an .empty? query to trigger loading the entire collection if the proxy had already been initialized

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1036 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 37270359
......@@ -25,8 +25,7 @@ def method_missing(symbol, *args, &block)
end
def respond_to?(symbol, include_priv = false)
load_target
proxy_respond_to?(symbol, include_priv) || @target.respond_to?(symbol, include_priv)
proxy_respond_to?(symbol, include_priv) || (load_target && @target.respond_to?(symbol, include_priv))
end
def loaded?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册