From 128a6411d2a60c855e3c99303d0157f436e32f13 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 25 Jan 2016 16:56:23 +0100 Subject: Don't pluck project IDs for events By instead using a sub-query we save ourselves the overhead of loading any data into memory only to pass it on to another query. --- app/controllers/dashboard/projects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/dashboard/projects_controller.rb') diff --git a/app/controllers/dashboard/projects_controller.rb b/app/controllers/dashboard/projects_controller.rb index 58e9049f158..0b7fcdf5e9e 100644 --- a/app/controllers/dashboard/projects_controller.rb +++ b/app/controllers/dashboard/projects_controller.rb @@ -36,7 +36,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController private def load_events - @events = Event.in_projects(@projects.pluck(:id)) + @events = Event.in_projects(@projects) @events = @event_filter.apply_filter(@events).with_associations @events = @events.limit(20).offset(params[:offset] || 0) end -- cgit v1.2.1