lib/bmg/operator/page.rb in bmg-0.10.0 vs lib/bmg/operator/page.rb in bmg-0.10.1
- old
+ new
@@ -44,12 +44,12 @@
protected ### inspect
def comparator
->(t1, t2) {
- ordering.each do |attr|
+ ordering.each do |(attr,direction)|
c = t1[attr] <=> t2[attr]
- return c unless c==0
+ return (direction == :desc ? -c : c) unless c==0
end
0
}
end