From 9d1d3b825f1d4c898415c6ec372ae0c8b81e7f49 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 13 Dec 2016 19:46:31 +0000 Subject: Improve custom fields list performance (#24587). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Thomas Löber. git-svn-id: http://svn.redmine.org/redmine/trunk@16069 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/custom_fields_controller.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/controllers/custom_fields_controller.rb') diff --git a/app/controllers/custom_fields_controller.rb b/app/controllers/custom_fields_controller.rb index 26e9b044d..71e4394f5 100644 --- a/app/controllers/custom_fields_controller.rb +++ b/app/controllers/custom_fields_controller.rb @@ -28,6 +28,8 @@ class CustomFieldsController < ApplicationController respond_to do |format| format.html { @custom_fields_by_type = CustomField.all.group_by {|f| f.class.name } + @custom_fields_projects_count = + IssueCustomField.where(is_for_all: false).joins(:projects).group(:custom_field_id).count } format.api { @custom_fields = CustomField.all -- cgit v1.2.3