Sha256: 06316fb7431395ebf170814e70e5908685f139ac740483a3662bd0d77de3febb

Contents?: true

Size: 488 Bytes

Versions: 7

Compression:

Stored size: 488 Bytes

Contents

module Arel
  class Order < Compound
    attributes :relation, :orderings
    deriving :==

    def initialize(relation, *orderings, &block)
      @relation = relation
      @orderings = (orderings + arguments_from_block(relation, &block)) \
        .collect { |o| o.bind(relation) }
    end

    # TESTME
    def orders
      # QUESTION - do we still need relation.orders ?
      (orderings + relation.orders).collect { |o| o.bind(self) }.collect { |o| o.to_ordering }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arel-0.3.1 lib/arel/algebra/relations/operations/order.rb
arel-0.3.0 lib/arel/algebra/relations/operations/order.rb
arel-0.2.1 lib/arel/algebra/relations/operations/order.rb
arel-0.2.0 lib/arel/algebra/relations/operations/order.rb
arel-0.2.pre lib/arel/algebra/relations/operations/order.rb
arel-0.1.2 lib/arel/algebra/relations/operations/order.rb
arel-0.1.0 lib/arel/algebra/relations/operations/order.rb