]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/browse_controller.rb
Make sure we order user changeset correctly for browse#changeset
[rails.git] / app / controllers / browse_controller.rb
index 0103516fff412641e81d15099abdb3daefb668ef..119792167da00507af99cacd3ac89d14c813c968 100644 (file)
@@ -70,8 +70,8 @@ class BrowseController < ApplicationController
     @prev = Changeset.where("id < ?", @changeset.id).order(:id => :desc).first
 
     if @changeset.user.data_public?
     @prev = Changeset.where("id < ?", @changeset.id).order(:id => :desc).first
 
     if @changeset.user.data_public?
-      @next_by_user = @changeset.user.changesets.where("id > ?", @changeset.id).order(:id => :asc).first
-      @prev_by_user = @changeset.user.changesets.where("id < ?", @changeset.id).order(:id => :desc).first
+      @next_by_user = @changeset.user.changesets.where("id > ?", @changeset.id).reorder(:id => :asc).first
+      @prev_by_user = @changeset.user.changesets.where("id < ?", @changeset.id).reorder(:id => :desc).first
     end
   rescue ActiveRecord::RecordNotFound
     render :action => "not_found", :status => :not_found
     end
   rescue ActiveRecord::RecordNotFound
     render :action => "not_found", :status => :not_found