diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-13 19:46:31 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-12-13 19:46:31 +0000 |
commit | 9d1d3b825f1d4c898415c6ec372ae0c8b81e7f49 (patch) | |
tree | 12ec34ec66f76068ab33afdf8954354b8f3eea23 /app/controllers | |
parent | 7b7a84c93a4fe57fdd14ec4729240939714ca412 (diff) | |
download | redmine-9d1d3b825f1d4c898415c6ec372ae0c8b81e7f49.tar.gz redmine-9d1d3b825f1d4c898415c6ec372ae0c8b81e7f49.zip |
Improve custom fields list performance (#24587).
Patch by Thomas Löber.
git-svn-id: http://svn.redmine.org/redmine/trunk@16069 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/custom_fields_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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 |