From 2bf36970a015f0a4a14ed49ba0be1fd955ddee5d Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Wed, 13 Jul 2016 20:55:31 +0200 Subject: removes a unnecessary limit call We are setting a limit unconditionally just below, which overrides any existing one anyway. --- activerecord/lib/active_record/relation/batches.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/relation/batches.rb b/activerecord/lib/active_record/relation/batches.rb index 46bb0e04ee..2b5c6fc739 100644 --- a/activerecord/lib/active_record/relation/batches.rb +++ b/activerecord/lib/active_record/relation/batches.rb @@ -205,7 +205,6 @@ module ActiveRecord if limit_value remaining = limit_value batch_limit = remaining if remaining < batch_limit - relation = relation.limit(nil) # new relation without the limit end relation = relation.reorder(batch_order).limit(batch_limit) -- cgit v1.2.3