1
0
Fork 0
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:
Aaron Patterson 2010-07-30 10:41:50 -07:00
parent 5bbd3d03d3
commit 1e327a5047
2 changed files with 1 additions and 12 deletions

View file

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

View file

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