aboutsummaryrefslogblamecommitdiffstats
path: root/lib/arel/algebra/ordering.rb
blob: 8439e937a94ce056808dd296f3304fa3d9527b72 (plain) (tree)
1
2
3
4
5
6
7
8

                
                                         
 


                                              
 



                   
 



                             
 



                             
   
module Arel
  class Ordering
    delegate :relation, :to => :attribute

    def bind(relation)
      self.class.new(attribute.bind(relation))
    end

    def to_ordering
      self
    end
  end

  class Ascending  < Ordering
    attributes :attribute
    deriving :initialize, :==
  end

  class Descending < Ordering
    attributes :attribute
    deriving :initialize, :==
  end
end