diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-12 14:26:57 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-12 14:27:08 -0800 |
commit | e9980f17fdca21655a9804d69632d83451067f58 (patch) | |
tree | f50a49a6b33e25e0ac9869faea750c74e659ca20 /activerecord/lib/active_record/associations | |
parent | bc993c690b656256e0f1dc5336a2f69c9d8dbe5d (diff) | |
download | rails-e9980f17fdca21655a9804d69632d83451067f58.tar.gz rails-e9980f17fdca21655a9804d69632d83451067f58.tar.bz2 rails-e9980f17fdca21655a9804d69632d83451067f58.zip |
just call methods on return value of `load_target`
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/association_proxy.rb | 11 |
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 |