aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/algebra/relations/operations/order.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/algebra/relations/operations/order.rb')
-rw-r--r--lib/arel/algebra/relations/operations/order.rb12
1 files changed, 11 insertions, 1 deletions
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