# File lib/dm-core/resource.rb, line 498 def <=>(other) model = self.model unless other.kind_of?(model.base_model) raise ArgumentError, "Cannot compare a #{other.class} instance with a #{model} instance" end model.default_order(repository_name).each do |direction| cmp = direction.get(self) <=> direction.get(other) return cmp if cmp.nonzero? end 0 end