mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
PERF: removing another def engine
This commit is contained in:
parent
5bbd3d03d3
commit
1e327a5047
2 changed files with 1 additions and 12 deletions
|
@ -12,17 +12,6 @@ module Arel
|
|||
@wheres ||= relation.wheres + predicates
|
||||
end
|
||||
|
||||
def engine
|
||||
engine = relation.engine
|
||||
|
||||
# Temporary check of whether or not the engine supports where.
|
||||
if engine.respond_to?(:supports) && !engine.supports(:restricting)
|
||||
Memory::Engine.new
|
||||
else
|
||||
engine
|
||||
end
|
||||
end
|
||||
|
||||
def eval
|
||||
unoperated_rows.select { |row| predicates.all? { |p| p.eval(row) } }
|
||||
end
|
||||
|
|
|
@ -13,7 +13,7 @@ module Arel
|
|||
|
||||
def read(relation)
|
||||
case relation
|
||||
when Arel::Take, Arel::Order, Arel::Skip
|
||||
when Arel::Take, Arel::Order, Arel::Skip, Arel::Where
|
||||
relation.eval
|
||||
else
|
||||
@rows.dup.map { |r| Row.new(relation, r) }
|
||||
|
|
Loading…
Reference in a new issue