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:
parent
50d7e448e8
commit
108df8cc90
1 changed files with 6 additions and 1 deletions
|
@ -52,7 +52,12 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
enum_for :find_each, options do
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue