spec/support/model.rb in arel-0.4.0 vs spec/support/model.rb in arel-1.0.0.rc1
- old
+ new
@@ -1,8 +1,8 @@
module Arel
module Testing
- class Engine
+ class Engine < Arel::Memory::Engine
attr_reader :rows
def initialize
@rows = []
end
@@ -10,10 +10,15 @@
def supports(operation)
false
end
def read(relation)
- @rows.dup.map { |r| Row.new(relation, r) }
+ case relation
+ when Arel::Take, Arel::Order, Arel::Skip, Arel::Where
+ relation.eval
+ else
+ @rows.dup.map { |r| Row.new(relation, r) }
+ end
end
def create(insert)
@rows << insert.record.tuple
insert