Permalink
Browse files

Really download the latest Git for Windows

There can be multiple installers for one git version with fixes for
the Windows distribution. Thus ordering only by 'versions.vorder' is
not enough, as we'll get a random downloader. Sort the entries by
filename so we get the latest installer.
  • Loading branch information...
1 parent dfe50c5 commit 7fe5a2d04aa4fa26ae0b9c1a515499a55e5d43ea @carlosmn carlosmn committed Sep 7, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/download.rb
@@ -7,6 +7,6 @@ class Download < ActiveRecord::Base
belongs_to :version
def self.latest_for(platform)
- includes(:version).where('platform=?', platform).order('versions.vorder DESC').first
+ includes(:version).where('platform=?', platform).order('versions.vorder DESC').order('downloads.filename DESC').first
end
end

2 comments on commit 7fe5a2d

@sschuberth
Member

Don't we need similar changes in doc_version.rb so that the text on the download page matches the file downloaded? Currently, we're (now correctly) downloading Git-1.7.11-preview20120710.exe, but the text says "It was released 3 months ago, on 2012-06-17", so it's mentioning the wrong release date.

@carlosmn

It's mentioning the Git release date, which is obviously the wrong date to show. This commit only deals with the file that gets downloaded which was IMO the most pressing issue.

Showing the release date for the installer would probably require a new field and a transition for both Windows and MacOS which is more complex. I'm going to see how we can handle this but it's going to take some trial and error.

Please sign in to comment.