From 2ca9b6dfab81c17bdad7d367c97e39c9ac25c075 Mon Sep 17 00:00:00 2001 From: knapo Date: Thu, 7 Jul 2011 11:40:11 +0200 Subject: Make `ActiveRecord::Batches#find_each` to not return `self`. This caused that `find_each` was producing extra db call taking all the records from db, and was less efficient than `ActiveRecord::Base#all`. --- activerecord/lib/active_record/relation/batches.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/relation/batches.rb b/activerecord/lib/active_record/relation/batches.rb index d52b84179f..46ab67d1cf 100644 --- a/activerecord/lib/active_record/relation/batches.rb +++ b/activerecord/lib/active_record/relation/batches.rb @@ -20,8 +20,6 @@ module ActiveRecord find_in_batches(options) do |records| records.each { |record| yield record } end - - self end # Yields each batch of records that was found by the find +options+ as -- cgit v1.2.3