Don't instantiate AR objects in Event.in_projects

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2017-02-09 12:19:32 +01:00
parent 85349c961c
commit a9924ee4d2
2 changed files with 5 additions and 1 deletions

View file

@ -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) }

View file

@ -0,0 +1,4 @@
---
title: Don't instantiate AR objects in Event.in_projects
merge_request:
author: