From 47309826e4d7d402c248ff507c4c4ef7a867449a Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Mon, 24 Jan 2011 22:27:48 +0000 Subject: load_target will return the target. it also will not load if loaded? is true. --- activerecord/lib/active_record/associations/association_collection.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activerecord/lib') 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 -- cgit v1.2.3