use a null object like a boss

This commit is contained in:
Colin Rymer 2013-07-18 16:37:34 -05:00
parent 55e2f5b6a1
commit 0a5936fecf
2 changed files with 14 additions and 11 deletions

7
app/models/null_time.rb Normal file
View file

@ -0,0 +1,7 @@
class NullTime
include Comparable
def <=>(another)
-1 # any other Time object is always greater
end
end