Defect #864

Sort order for files confusing when end dates the same

Added by John Goerzen over 14 years ago. Updated over 14 years ago.

Status:ClosedStart date:2008-03-15
Priority:NormalDue date:
Assignee:-% Done:


Target version:0.7
Resolution:Fixed Affected version:



Back in defect #763 (and r1192), I submitted a patch that changed the sort order for files to put the most recent release at the top. All it did was add ".reverse" to the end of this line:

    @versions = @project.versions.sort.reverse

It appears that project.versions sorts by date, not by name. That is not necessarily the problem. But it is a problem when multiple versions have the same end date. The net result of that, in the above situation, is that within a given date, the projects sort approximately ascending (oldest first), but between multiple dates, they sort descending (newest first), as desired. I say "approximately ascending" because there are a few versions that are out of place, both in the Roadmap screen and the Files screen.

As I'm importing files from Trac, I happen to be setting up a bunch of versions with today's end date.

I have no idea why this is happening, but if I were to venture a guess, I'd say Ruby has a feature where a custom sort ordering can be imposed on a type, and versions sort order is creating this behavior.

Associated revisions

Revision 1296
Added by Jean-Philippe Lang over 14 years ago

Make the versions with the same date sorted by name (#864).


#1 Updated by Jean-Philippe Lang over 14 years ago

  • Status changed from New to Resolved
  • Target version set to 0.7
  • Resolution set to Fixed

No particular order was set for versions with the same date (in Version#<=>).
Now versions with the same date are sorted by name (r1296).

#2 Updated by Jean-Philippe Lang over 14 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF