This method is only available on newer versions.
The first available version (v8.0.0) is shown here.
compare_values_for_order(values1, values2, order)
private
This is a custom implementation of `<=>` operator, which also takes
into account how the collection will be ordered.
# File activerecord/lib/active_record/relation/batches.rb, line 414
def compare_values_for_order(values1, values2, order)
values1.each_with_index do |element1, index|
element2 = values2[index]
direction = order[index]
comparison = element1 <=> element2
comparison = -comparison if direction == :desc
return comparison if comparison != 0
end
0
end