aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-06-28 06:00:20 -0700
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-06-28 06:00:20 -0700
commit8f63515f6efbc5c342dc9af9aa936e72261a18fe (patch)
tree2a06d57aec360e76150c8e658ec58bd1fa512137 /activerecord/lib
parent5e6de3942ffbc667d1f43860a0c80dd8031a0c60 (diff)
parent1cf6871a9e3124ff6b74a315c4bef9dc427da5f9 (diff)
downloadrails-8f63515f6efbc5c342dc9af9aa936e72261a18fe.tar.gz
rails-8f63515f6efbc5c342dc9af9aa936e72261a18fe.tar.bz2
rails-8f63515f6efbc5c342dc9af9aa936e72261a18fe.zip
Merge pull request #11161 from dmitry/find_in_batches_works_without_logger
ActiveRecord find_in_batches should work without logger When I set logger to nil both methods from Batches module find_in_batches or find_each should work anyway.
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 91ea1756c4..fd8496442e 100644
--- a/activerecord/lib/active_record/relation/batches.rb
+++ b/activerecord/lib/active_record/relation/batches.rb
@@ -89,8 +89,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)