##// END OF EJS Templates
Improve custom fields list performance (#24587)....
Jean-Philippe Lang -
r15687:9d1d3b825f1d
parent child
Show More
@@ -28,6 +28,8 class CustomFieldsController < ApplicationController
28 respond_to do |format|
28 respond_to do |format|
29 format.html {
29 format.html {
30 @custom_fields_by_type = CustomField.all.group_by {|f| f.class.name }
30 @custom_fields_by_type = CustomField.all.group_by {|f| f.class.name }
31 @custom_fields_projects_count =
32 IssueCustomField.where(is_for_all: false).joins(:projects).group(:custom_field_id).count
31 }
33 }
32 format.api {
34 format.api {
33 @custom_fields = CustomField.all
35 @custom_fields = CustomField.all
@@ -18,7 +18,7
18 <td><%= checked_image custom_field.is_required? %></td>
18 <td><%= checked_image custom_field.is_required? %></td>
19 <% if tab[:name] == 'IssueCustomField' %>
19 <% if tab[:name] == 'IssueCustomField' %>
20 <td><%= checked_image custom_field.is_for_all? %></td>
20 <td><%= checked_image custom_field.is_for_all? %></td>
21 <td><%= l(:label_x_projects, :count => custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td>
21 <td><%= l(:label_x_projects, :count => @custom_fields_projects_count[custom_field.id]) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td>
22 <% end %>
22 <% end %>
23 <td class="buttons">
23 <td class="buttons">
24 <%= reorder_handle(custom_field, :url => custom_field_path(custom_field), :param => 'custom_field') %>
24 <%= reorder_handle(custom_field, :url => custom_field_path(custom_field), :param => 'custom_field') %>
General Comments 0
You need to be logged in to leave comments. Login now