]> git.openstreetmap.org Git - rails.git/commitdiff
Only show each note once is the user notes view
authorTom Hughes <tom@compton.nu>
Sun, 3 Feb 2013 11:07:01 +0000 (11:07 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 3 Feb 2013 11:07:01 +0000 (11:07 +0000)
app/controllers/notes_controller.rb

index 11d0f8cb43aaf79aee313004c843c70b1084a08b..1f5b990cc818cd2cc9c008da0dceaed88bb4f87f 100644 (file)
@@ -239,7 +239,7 @@ class NotesController < ApplicationController
         @description = t 'note.mine.subheading', :user => render_to_string(:partial => "user", :object => @this_user)
         @page = (params[:page] || 1).to_i 
         @page_size = 10
-        @notes = @this_user.notes.order("updated_at DESC").offset((@page - 1) * @page_size).limit(@page_size).preload(:comments => :author)
+        @notes = @this_user.notes.order("updated_at DESC, id").uniq.offset((@page - 1) * @page_size).limit(@page_size).preload(:comments => :author)
       else
         @title = t 'user.no_such_user.title' 
         @not_found_user = params[:display_name]