aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/relation/batches.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/batches.rb b/activerecord/lib/active_record/relation/batches.rb
index 9f20db831b..f7b2167ae8 100644
--- a/activerecord/lib/active_record/relation/batches.rb
+++ b/activerecord/lib/active_record/relation/batches.rb
@@ -52,7 +52,12 @@ module ActiveRecord
end
else
enum_for :find_each, options do
- options[:start] ? where(table[primary_key].gteq(options[:start])).size : size
+ # FIXME: Remove this when type casting is removed from Arel
+ # (Rails 5.1). We can pass start directly instead.
+ if options[:start]
+ quoted_start = Arel::Nodes::Quoted.new(options[:start])
+ end
+ options[:start] ? where(table[primary_key].gteq(quoted_start)).size : size
end
end
end