]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/api/notes_controller.rb
Add some additional preloads to notes#feed
[rails.git] / app / controllers / api / notes_controller.rb
index 83024288db43d9963249c301faca3180f457fce8..c489f96be43964640adff2446b154b06e46c6fa2 100644 (file)
@@ -251,7 +251,9 @@ module Api
       end
 
       # Find the comments we want to return
       end
 
       # Find the comments we want to return
-      @comments = NoteComment.where(:note_id => notes).order("created_at DESC").limit(result_limit).preload(:note)
+      @comments = NoteComment.where(:note => notes)
+                             .order(:created_at => :desc).limit(result_limit)
+                             .preload(:author, :note => { :comments => :author })
 
       # Render the result
       respond_to do |format|
 
       # Render the result
       respond_to do |format|