From 10c4b42c35f61145ac6ebb8d36f504344eef47cd Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sun, 17 May 2009 18:21:56 -0400 Subject: Fix bug in Order equality where Descending.new(attribute) was == Ascending.new(attribute) --- lib/arel/algebra/primitives/ordering.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/arel/algebra/primitives/ordering.rb b/lib/arel/algebra/primitives/ordering.rb index a60d794f27..3efb4c6280 100644 --- a/lib/arel/algebra/primitives/ordering.rb +++ b/lib/arel/algebra/primitives/ordering.rb @@ -1,7 +1,5 @@ module Arel class Ordering - attributes :attribute - deriving :initialize, :== delegate :relation, :to => :attribute def bind(relation) @@ -13,6 +11,13 @@ module Arel end end - class Ascending < Ordering; end - class Descending < Ordering; end + class Ascending < Ordering + attributes :attribute + deriving :initialize, :== + end + + class Descending < Ordering + attributes :attribute + deriving :initialize, :== + end end -- cgit v1.2.3