Don't instantiate AR objects in Event.in_projects
Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
85349c961c
commit
a9924ee4d2
2 changed files with 5 additions and 1 deletions
|
@ -36,7 +36,7 @@ class Event < ActiveRecord::Base
|
|||
scope :code_push, -> { where(action: PUSHED) }
|
||||
|
||||
scope :in_projects, ->(projects) do
|
||||
where(project_id: projects.map(&:id)).recent
|
||||
where(project_id: projects).recent
|
||||
end
|
||||
|
||||
scope :with_associations, -> { includes(project: :namespace) }
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Don't instantiate AR objects in Event.in_projects
|
||||
merge_request:
|
||||
author:
|
Loading…
Reference in a new issue