I have a ticket model which has a method inside called closes_in
that calculates the time left from the DB field start_date:date
to now. Currently my find query is:
@tickets = Ticket.find(:all,
:origin => @user.coords,
:order => 'distance',
I can't just put in closes_in as I get an error. How do I make it so I can use closes_in
to sort the query if it's a method and not an actual field in the DB?