Commit 84cdce2d authored by Rémy Coutable's avatar Rémy Coutable

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

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 9676aad8
......@@ -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') }
......
---
title: Include :author, :project, and :target in Event.with_associations
merge_request:
author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment