From e4eb64bab3eaa40ce22f0d0c7d008c6eea2988ca Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sun, 25 Jul 2010 17:33:13 -0700 Subject: moving engine to the child class for future refactoring --- lib/arel/algebra/relations/operations/order.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/arel/algebra') diff --git a/lib/arel/algebra/relations/operations/order.rb b/lib/arel/algebra/relations/operations/order.rb index bb5ac1ab88..582abf642c 100644 --- a/lib/arel/algebra/relations/operations/order.rb +++ b/lib/arel/algebra/relations/operations/order.rb @@ -1,7 +1,6 @@ module Arel class Order < Compound attr_reader :orderings - requires :ordering def initialize(relation, *orderings, &block) super(relation) @@ -21,5 +20,16 @@ module Arel # QUESTION - do we still need relation.orders ? (orderings + relation.orders).collect { |o| o.bind(self) }.collect { |o| o.to_ordering } end + + def engine + engine = relation.engine + + # Temporary check of whether or not the engine supports where. + if engine.respond_to?(:supports) && !engine.supports(:ordering) + Memory::Engine.new + else + engine + end + end end end -- cgit v1.2.3