Sha256: 845261a8129a892bf7cb83683134a269b9ade9e69859b30014d64593256efb88

Contents?: true

Size: 437 Bytes

Versions: 4

Compression:

Stored size: 437 Bytes

Contents

module Arel
  module Nodes
    class Descending < Ordering

      attr_accessor :nulls

      def initialize expr, nulls=nil
        super(expr)
        @nulls = nulls
      end

      def reverse
        reverse_nulls = if nulls == :nulls_first
          :nulls_last
        elsif nulls
          :nulls_first
        else
          nil
        end
        
        Ascending.new(expr, reverse_nulls)
      end
      
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
arel-extensions-7.0.3 ext/arel/nodes/descending.rb
arel-extensions-7.0.2 ext/arel/nodes/descending.rb
arel-extensions-7.0.1 ext/arel/nodes/descending.rb
arel-extensions-7.0.0 ext/arel/nodes/descending.rb