diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -8,7 +8,8 @@ # GET /announcements # GET /announcements.xml def index - @announcements = Announcement.find(:all) + @announcements = Announcement.find(:all, + :order => "created_at DESC") respond_to do |format| format.html # index.html.erb diff --git a/app/models/submission.rb b/app/models/submission.rb --- a/app/models/submission.rb +++ b/app/models/submission.rb @@ -30,7 +30,8 @@ "(SELECT MAX(id) FROM submissions AS subs " + "WHERE subs.user_id = submissions.user_id AND " + "problem_id = " + problem_id.to_s + " " + - "GROUP BY user_id)") + "GROUP BY user_id) " + + "ORDER BY user_id") end def self.find_last_for_all_available_problems(user_id) diff --git a/app/views/announcements/index.html.erb b/app/views/announcements/index.html.erb --- a/app/views/announcements/index.html.erb +++ b/app/views/announcements/index.html.erb @@ -5,6 +5,8 @@
Body |
---|