Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-06-03 14:36:22 +0300
committerStan Hu <stanhu@gmail.com>2018-06-05 17:22:07 +0300
commit6f4a0a92e6331b7033a8165c5b5e9cc7b0f880c2 (patch)
treeadc1945dc9672c998c00897ab896ee867d1dab7c /lib/api/events.rb
parent5426f09f4ab088f75bc84d043e2ac2fe4e852c44 (diff)
Eliminate N+1 queries with authors and push_data_payload in Events API
Diffstat (limited to 'lib/api/events.rb')
-rw-r--r--lib/api/events.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/api/events.rb b/lib/api/events.rb
index b0713ff1d54..fc4ba5a3188 100644
--- a/lib/api/events.rb
+++ b/lib/api/events.rb
@@ -17,6 +17,7 @@ module API
def present_events(events)
events = events.reorder(created_at: params[:sort])
+ .with_associations
present paginate(events), with: Entities::Event
end