From caf89fe3415982fd0b593ffcda9a58a083aa7e78 Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Fri, 18 Apr 2008 15:14:39 -0700 Subject: in fact, when doing subsequent orderings, we assume that the previous orderings have taken effect and therefore where the new ordering finds things equal, the previous ordering should take effect --- lib/arel/relations/order.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/arel/relations/order.rb b/lib/arel/relations/order.rb index b1454973c8..662d3740df 100644 --- a/lib/arel/relations/order.rb +++ b/lib/arel/relations/order.rb @@ -1,15 +1,19 @@ module Arel class Order < Compound - attr_reader :orders - - def initialize(relation, *orders) - @relation, @orders = relation, orders.collect { |o| o.bind(relation) } + attr_reader :orderings + + def initialize(relation, *orderings) + @relation, @orderings = relation, orderings.collect { |o| o.bind(relation) } end def ==(other) self.class == other.class and relation == other.relation and - orders == other.orders + orderings == other.orderings + end + + def orders + orderings + relation.orders end end end \ No newline at end of file -- cgit v1.2.3