]> git.openstreetmap.org Git - rails.git/commitdiff
Add some additional preloads to notes#feed
authorTom Hughes <tom@compton.nu>
Sat, 2 Sep 2023 10:39:02 +0000 (11:39 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 2 Sep 2023 10:44:59 +0000 (11:44 +0100)
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|