diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-27 11:51:45 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-02-27 11:51:45 +0000 |
commit | a39d65b8f6e1a23c00cb1f076e9893f9642ad3b1 (patch) | |
tree | 2f6a17524c24671d31966a1c7dda34a6a9d149a1 /app | |
parent | ac4ac5f2e20136dc378bdba15f40d0a3d2dcc69f (diff) | |
parent | 1286151578af69e88d267d0dc3294ef1ed0062c2 (diff) | |
download | gitlab-ce-a39d65b8f6e1a23c00cb1f076e9893f9642ad3b1.tar.gz |
Merge branch '27267-events-project-query-performance-regression' into 'master'
Query performance regression fix affecting "Dashboard::ProjectsController#index.atom"
Closes #27267
See merge request !9526
Diffstat (limited to 'app')
-rw-r--r-- | app/models/event.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/event.rb b/app/models/event.rb index 4b8eac9accf..d7ca8e3c599 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -36,7 +36,7 @@ class Event < ActiveRecord::Base scope :code_push, -> { where(action: PUSHED) } scope :in_projects, ->(projects) do - where(project_id: projects).recent + where(project_id: projects.pluck(:id)).recent end scope :with_associations, -> { includes(:author, :project, project: :namespace).preload(:target) } |