From: Tom Hughes Date: Sat, 2 Sep 2023 10:39:02 +0000 (+0100) Subject: Add some additional preloads to notes#feed X-Git-Tag: live~1036 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/704781ad0b108e80e4c6eef030c8c1c785e815e4?hp=abecde92f5c4adbdd3882f833787f3f8cdbd564b Add some additional preloads to notes#feed --- diff --git a/app/controllers/api/notes_controller.rb b/app/controllers/api/notes_controller.rb index e6f391ede..c489f96be 100644 --- a/app/controllers/api/notes_controller.rb +++ b/app/controllers/api/notes_controller.rb @@ -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|