Methods

Files

Class Index [+]

Quicksearch

Arel::Order

Attributes

orderings[R]

Public Class Methods

new(relation, orderings) click to toggle source
   # File lib/arel/algebra/relations/operations/order.rb, line 5
5:     def initialize(relation, orderings)
6:       super(relation)
7:       @orderings = orderings.collect { |o| o.bind(relation) }
8:     end

Public Instance Methods

eval() click to toggle source
    # File lib/arel/algebra/relations/operations/order.rb, line 16
16:     def eval
17:       unoperated_rows.sort do |row1, row2|
18:         ordering = orders.detect { |o| o.eval(row1, row2) != 0 } || orders.last
19:         ordering.eval(row1, row2)
20:       end
21:     end
orders() click to toggle source

TESTME

    # File lib/arel/algebra/relations/operations/order.rb, line 11
11:     def orders
12:       # QUESTION - do we still need relation.orders ?
13:       (orderings + relation.orders).collect { |o| o.bind(self) }.collect { |o| o.to_ordering }
14:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.