diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-25 17:33:13 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-25 17:33:40 -0700 |
commit | e4eb64bab3eaa40ce22f0d0c7d008c6eea2988ca (patch) | |
tree | 6721838b74dd6042cfaa8297b6cbc2a720a99683 | |
parent | 5ad24febb4de206a5f5075259569223dcc09b6d6 (diff) | |
download | rails-e4eb64bab3eaa40ce22f0d0c7d008c6eea2988ca.tar.gz rails-e4eb64bab3eaa40ce22f0d0c7d008c6eea2988ca.tar.bz2 rails-e4eb64bab3eaa40ce22f0d0c7d008c6eea2988ca.zip |
moving engine to the child class for future refactoring
-rw-r--r-- | lib/arel/algebra/relations/operations/order.rb | 12 |
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 |