From e9980f17fdca21655a9804d69632d83451067f58 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 12 Jan 2011 14:26:57 -0800 Subject: just call methods on return value of `load_target` --- .../lib/active_record/associations/association_proxy.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb index ee0631edb6..a51adce958 100644 --- a/activerecord/lib/active_record/associations/association_proxy.rb +++ b/activerecord/lib/active_record/associations/association_proxy.rb @@ -150,17 +150,12 @@ module ActiveRecord # Forwards the call to the target. Loads the \target if needed. def inspect - load_target - @target.inspect + load_target.inspect end def send(method, *args) - if respond_to?(method) - super - else - load_target - @target.send(method, *args) - end + return super if respond_to?(method) + load_target.send(method, *args) end def scoped -- cgit v1.2.3