From 9325bafbbf17da50dd8e5855e12fdff4ed590ea1 Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Fri, 25 Jul 2014 15:42:33 +0100 Subject: Fixed poll list to list the 5 most recent polls --- blavote.go | 2 +- poll.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blavote.go b/blavote.go index 7de8a56..c14e8e4 100644 --- a/blavote.go +++ b/blavote.go @@ -14,7 +14,7 @@ var version string func main() { - version = "0.7.1" + version = "0.7.2" //Command line arguments var opts struct { diff --git a/poll.go b/poll.go index 8a204f1..eda5a8f 100644 --- a/poll.go +++ b/poll.go @@ -148,7 +148,7 @@ func hasUserVotedInPoll(db *sqlite3.Conn, poll Poll, user User) bool { func getRecentPolls(db *sqlite3.Conn) ([]Poll, error) { - sql := "SELECT * FROM polls LIMIT 5" + sql := "SELECT * FROM polls ORDER BY id DESC LIMIT 5" s, err := db.Query(sql) row := make(sqlite3.RowMap) var polls = make([]Poll, 5) -- cgit v1.2.3