Permalink
Browse files

load_target will return the target. it also will not load if loaded? …

…is true.
  • Loading branch information...
1 parent b7bcc7e commit 47309826e4d7d402c248ff507c4c4ef7a867449a @jonleighton jonleighton committed Jan 24, 2011
Showing with 1 addition and 2 deletions.
  1. +1 −2 activerecord/lib/active_record/associations/association_collection.rb
@@ -553,9 +553,8 @@ def first_or_last(type, *args)
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

0 comments on commit 4730982

Please sign in to comment.