summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-02-09 12:19:55 +0100
committerRémy Coutable <remy@rymai.me>2017-02-13 15:23:23 +0100
commit473b04a9f07ded15538af23f986ec618f5f8160c (patch)
tree647d8c74d1a86430cbefc0af1ce0af3cf359696f
parenta9924ee4d299b96da1e8dd58a6c9ed42b5dfacbd (diff)
downloadgitlab-ce-473b04a9f07ded15538af23f986ec618f5f8160c.tar.gz
Include :author, :project, and :target in Event.with_associations
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--app/models/event.rb2
-rw-r--r--changelogs/unreleased/27395-reduce-group-activity-sql-queries-2.yml4
2 files changed, 5 insertions, 1 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index c90fee95426..57f441187b4 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -39,7 +39,7 @@ class Event < ActiveRecord::Base
where(project_id: projects).recent
end
- scope :with_associations, -> { includes(project: :namespace) }
+ scope :with_associations, -> { includes(:author, :project, :target, project: :namespace) }
scope :for_milestone_id, ->(milestone_id) { where(target_type: "Milestone", target_id: milestone_id) }
class << self
diff --git a/changelogs/unreleased/27395-reduce-group-activity-sql-queries-2.yml b/changelogs/unreleased/27395-reduce-group-activity-sql-queries-2.yml
new file mode 100644
index 00000000000..f3ce1709518
--- /dev/null
+++ b/changelogs/unreleased/27395-reduce-group-activity-sql-queries-2.yml
@@ -0,0 +1,4 @@
+---
+title: Include :author, :project, and :target in Event.with_associations
+merge_request:
+author: