lib/veritas/optimizer/relation/operation/order.rb in veritas-optimizer-0.0.5 vs lib/veritas/optimizer/relation/operation/order.rb in veritas-optimizer-0.0.6
- old
+ new
@@ -24,12 +24,11 @@
#
# @return [Order]
#
# @api private
def optimize
- operation = self.operation
- operation.class.new(operand.operand, operation.directions)
+ operand.operand.sort_by { operation.directions }
end
end # class OrderOperand
# Optimize when the operand is a Limit with a limit of 1
@@ -65,11 +64,10 @@
#
# @return [Offset]
#
# @api private
def optimize
- operation = self.operation
- operation.class.new(operand, operation.directions)
+ operand.sort_by { operation.directions }
end
end # class UnoptimizedOperand
Veritas::Relation::Operation::Order.optimizer = chain(