aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-01-24 22:27:48 +0000
committerJon Leighton <j@jonathanleighton.com>2011-01-30 11:58:08 +0000
commit47309826e4d7d402c248ff507c4c4ef7a867449a (patch)
tree60312c79741ae81241abccc092f66184100d1767
parentb7bcc7e1905062f330e0a84b93a1ecacfea2a4c0 (diff)
downloadrails-47309826e4d7d402c248ff507c4c4ef7a867449a.tar.gz
rails-47309826e4d7d402c248ff507c4c4ef7a867449a.tar.bz2
rails-47309826e4d7d402c248ff507c4c4ef7a867449a.zip
load_target will return the target. it also will not load if loaded? is true.
-rw-r--r--activerecord/lib/active_record/associations/association_collection.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb
index a59de18313..07b5b07195 100644
--- a/activerecord/lib/active_record/associations/association_collection.rb
+++ b/activerecord/lib/active_record/associations/association_collection.rb
@@ -553,9 +553,8 @@ module ActiveRecord
if fetch_first_or_last_using_find?(args)
scoped.send(type, *args)
else
- load_target unless loaded?
args.shift if args.first.kind_of?(Hash) && args.first.empty?
- @target.send(type, *args)
+ load_target.send(type, *args)
end
end
end