Skip to content
Snippets Groups Projects
Commit 84cdce2d authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Include :author, :project, and :target in Event.with_associations


Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 9676aad8
No related branches found
No related tags found
1 merge request!1226[EE] Resolve "GroupsController#activity.json is REALLY slow due to SQL"
Loading
Loading
@@ -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) }
scope :issues, -> { where(target_type: 'Issue') }
scope :merge_requests, -> { where(target_type: 'MergeRequest') }
Loading
Loading
---
title: Include :author, :project, and :target in Event.with_associations
merge_request:
author:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment