From 5ad24febb4de206a5f5075259569223dcc09b6d6 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sun, 25 Jul 2010 17:30:22 -0700 Subject: removing more meta programming --- lib/arel/algebra/relations/operations/order.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/arel/algebra') diff --git a/lib/arel/algebra/relations/operations/order.rb b/lib/arel/algebra/relations/operations/order.rb index df54735630..bb5ac1ab88 100644 --- a/lib/arel/algebra/relations/operations/order.rb +++ b/lib/arel/algebra/relations/operations/order.rb @@ -1,15 +1,21 @@ module Arel class Order < Compound - attributes :relation, :orderings - deriving :== + attr_reader :orderings requires :ordering def initialize(relation, *orderings, &block) - @relation = relation + super(relation) @orderings = (orderings + arguments_from_block(relation, &block)) \ .collect { |o| o.bind(relation) } end + def == other + super || + Order === other && + relation == other.relation && + orderings == other.orderings + end + # TESTME def orders # QUESTION - do we still need relation.orders ? -- cgit v1.2.3