# File lib/dm-core/query/sort.rb, line 15 def <=>(other) other_value = other.value value_nil = @value.nil? other_nil = other_value.nil? cmp = case when value_nil then other_nil ? 0 : 1 when other_nil then -1 else @value <=> other_value end @ascending ? cmp : cmp * -1 end