From: Michael Orlitzky Date: Wed, 4 Nov 2015 23:13:41 +0000 (-0500) Subject: Allow sorting of User/Domain for testing. X-Git-Tag: 0.0.1~23 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=30e96ed6093c479e7605b23a68aba7da11297679;p=mailshears.git Allow sorting of User/Domain for testing. --- diff --git a/lib/common/domain.rb b/lib/common/domain.rb index 5fb345b..ec4fecf 100644 --- a/lib/common/domain.rb +++ b/lib/common/domain.rb @@ -20,4 +20,8 @@ class Domain def ==(other) return self.to_s() == other.to_s() end + + def <=>(other) + return self.to_s() <=> other.to_s() + end end diff --git a/lib/common/user.rb b/lib/common/user.rb index bb239d1..f67d044 100644 --- a/lib/common/user.rb +++ b/lib/common/user.rb @@ -60,4 +60,8 @@ class User def ==(other) return self.to_s() == other.to_s() end + + def <=>(other) + return self.to_s() <=> other.to_s() + end end