aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/relations/order.rb
blob: b1454973c8619f62ff92e8a52e8e3653388c8d01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Arel
  class Order < Compound
    attr_reader :orders

    def initialize(relation, *orders)
      @relation, @orders = relation, orders.collect { |o| o.bind(relation) }
    end

    def ==(other)
      self.class  == other.class    and
      relation    == other.relation and
      orders      == other.orders
    end
  end
end