1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Inform Arel we don't need additional type casting in batches

Part of the larger refactoring to remove type casting from Arel. We can
inform it that we already have the right type by wrapping the value in
an `Arel::Nodes::Quoted`. This commit can be reverted when we have
removed type casting from Arel in Rail 5.1
This commit is contained in:
Sean Griffin 2014-12-26 17:48:08 -07:00
parent 50d7e448e8
commit 108df8cc90

View file

@ -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