From 1cf6871a9e3124ff6b74a315c4bef9dc427da5f9 Mon Sep 17 00:00:00 2001 From: Dmitry Polushkin Date: Fri, 28 Jun 2013 12:07:34 +0100 Subject: find_in_batches should work without logger --- activerecord/lib/active_record/relation/batches.rb | 4 ++-- 1 file changed, 2 insertions(+), 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 41291844fc..341769b5c4 100644 --- a/activerecord/lib/active_record/relation/batches.rb +++ b/activerecord/lib/active_record/relation/batches.rb @@ -78,8 +78,8 @@ module ActiveRecord relation = self - unless arel.orders.blank? && arel.taken.blank? - ActiveRecord::Base.logger.warn("Scoped order and limit are ignored, it's forced to be batch order and batch size") + if logger && (arel.orders.present? || arel.taken.present?) + logger.warn("Scoped order and limit are ignored, it's forced to be batch order and batch size") end start = options.delete(:start) -- cgit v1.2.3