]> 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 e6f391ede96e3767e7c5c08f9c210e3a744a9f8c..c489f96be43964640adff2446b154b06e46c6fa2 100644 (file)
@@ -251,7 +251,9 @@ module Api
       end
 
       # Find the comments we want to return
-      @comments = NoteComment.where(:note => 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|