lib/locomotive/steam/adapters/memory/order.rb in locomotivecms_steam-1.0.1 vs lib/locomotive/steam/adapters/memory/order.rb in locomotivecms_steam-1.1.0.rc1
- old
+ new
@@ -49,14 +49,14 @@
attr_reader :obj
def initialize(obj); @obj = obj; end
end
class Asc < Direction
- def <=>(other); @obj <=> other.obj; end
+ def <=>(other) @obj && other.obj ? @obj <=> other.obj : @obj ? -1 : 1; end
end
class Desc < Direction
- def <=>(other); other.obj <=> @obj; end
+ def <=>(other); @obj && other.obj ? other.obj <=> @obj : @obj ? -1 : 1; end
end
end
end