make nearest a class method

````ruby
Ticket.nearest
NoMethodError: undefined method `nearest' for Ticket:Class
````

I added the method to the class the way I saw the json plugin do it, so hopefully I've done this the correct way.