From 6ef14147de83fde6971f9663d03e8abe5a791aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 10 Feb 2012 16:27:27 +0100 Subject: [PATCH] Correctly identify latest stable git version Maintenance releases for version n-1 and n-2 can have later dates than the latest stable n, so they're not a good way to determine the latest release. The latest release should be calculated using the version number alone. --- app.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.rb b/app.rb index 7ef31af..acf19d1 100644 --- a/app.rb +++ b/app.rb @@ -6,7 +6,7 @@ require './lib/version' class GitApp < Sinatra::Base def get_version - if v = Version.first(:order => [:created_at.desc]) + if v = Version.last(:order => [:version]) @version = v.version @date = v.created_at.strftime("%Y-%m-%d") end