mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
This commit is contained in:
parent
37270359ac
commit
715715aed4
1 changed files with 1 additions and 2 deletions
|
@ -25,8 +25,7 @@ module ActiveRecord
|
|||
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?
|
||||
|
|
Loading…
Reference in a new issue