From 8a1de9b2522b0c270d5f59bfba524638ebd2ca76 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 13 May 2011 23:40:56 +0100 Subject: Instead of doing find(:all) which does scoped.find(:all) which does scoped.all, just do scoped.all. --- activerecord/lib/active_record/associations/collection_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/associations/collection_association.rb b/activerecord/lib/active_record/associations/collection_association.rb index 858317550d..4429c655a2 100644 --- a/activerecord/lib/active_record/associations/collection_association.rb +++ b/activerecord/lib/active_record/associations/collection_association.rb @@ -379,7 +379,7 @@ module ActiveRecord if options[:finder_sql] reflection.klass.find_by_sql(custom_finder_sql) else - find(:all) + scoped.all end records = options[:uniq] ? uniq(records) : records -- cgit v1.2.3