Bug #5388
Sorting should be done correctly and efficiently
| Status: | Rejected | Start date: | 11/24/2010 | |
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
| Keywords: | Affected URL: | |||
| Branch: | Affected Dashboard version: | 1.0.5 | ||
| Votes: | 0 |
Description
Commit ad7a1c1f attempts to add sorting, but instead adds a bunch of bugs. Commit 3c48dadb attempts to add workarounds to fix some, but possibly not all, of the bugs in the earlier commit, and possibly adds a new bug by removing some sorting. These two commits are badly-designed, inefficient and the work should be redone. Do not “.sort” unsortable objects. Do not sort database records with Ruby (e.g. “.sort” and “<=>”) — use the database to sort database records. Do not add model logic (e.g. custom sorting) to views — put model logic into models. Do not use default model sorting because it slows down all queries using that model, and many queries won’t need that sorting. Do write tests, they would have caught these bugs. Do check that your code works, simply loading the pages would have caught these bugs.
History
Updated by Nigel Kersten over 1 year ago
- Target version deleted (
1.0.5)
Updated by Nigel Kersten over 1 year ago
- Affected Dashboard version set to 1.0.5
Updated by James Turnbull over 1 year ago
- Status changed from Unreviewed to Accepted
Updated by Nick Lewis over 1 year ago
- Status changed from Accepted to Rejected
The code works and does not have performance concerns. This ticket is merely a stylistic one.