aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-01-12 14:26:57 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2011-01-12 14:27:08 -0800
commite9980f17fdca21655a9804d69632d83451067f58 (patch)
treef50a49a6b33e25e0ac9869faea750c74e659ca20
parentbc993c690b656256e0f1dc5336a2f69c9d8dbe5d (diff)
downloadrails-e9980f17fdca21655a9804d69632d83451067f58.tar.gz
rails-e9980f17fdca21655a9804d69632d83451067f58.tar.bz2
rails-e9980f17fdca21655a9804d69632d83451067f58.zip
just call methods on return value of `load_target`
-rw-r--r--activerecord/lib/active_record/associations/association_proxy.rb11
1 files 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