diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/relations/order.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/arel/relations/order.rb b/lib/arel/relations/order.rb index 91526da02c..b1454973c8 100644 --- a/lib/arel/relations/order.rb +++ b/lib/arel/relations/order.rb @@ -1,21 +1,15 @@ module Arel class Order < Compound - attr_reader :ordering + attr_reader :orders def initialize(relation, *orders) - ordering = orders.pop - @relation = orders.empty?? relation : Order.new(relation, *orders) - @ordering = ordering.bind(@relation) + @relation, @orders = relation, orders.collect { |o| o.bind(relation) } end def ==(other) self.class == other.class and relation == other.relation and - ordering == other.ordering - end - - def orders - relation.orders + [ordering] + orders == other.orders end end end
\ No newline at end of file |