aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorDmitry Polushkin <dmitry.polushkin@gmail.com>2013-06-28 12:07:34 +0100
committerDmitry Polushkin <dmitry.polushkin@gmail.com>2013-06-28 13:51:00 +0100
commit1cf6871a9e3124ff6b74a315c4bef9dc427da5f9 (patch)
tree1ea82db280fee3991e05877e0fc6b2ba61608fd4 /activerecord/lib
parent7c69a829a311a31109939cff19b700b36b97d5c4 (diff)
downloadrails-1cf6871a9e3124ff6b74a315c4bef9dc427da5f9.tar.gz
rails-1cf6871a9e3124ff6b74a315c4bef9dc427da5f9.tar.bz2
rails-1cf6871a9e3124ff6b74a315c4bef9dc427da5f9.zip
find_in_batches should work without logger
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/relation/batches.rb4
1 files changed, 2 insertions, 2 deletions
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)