summaryrefslogtreecommitdiffstats
path: root/app/views/projects
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2022-02-14 08:08:47 +0000
committerGo MAEDA <maeda@farend.jp>2022-02-14 08:08:47 +0000
commitb0e1f8d8f38bd538d668633f0a4ce5c8e67feae1 (patch)
tree5770d3081ff2004c01155b7f062b7ef1f21b2a58 /app/views/projects
parenta043021151358274d5ecaf48e5341af44f5fdf1d (diff)
downloadredmine-b0e1f8d8f38bd538d668633f0a4ce5c8e67feae1.tar.gz
redmine-b0e1f8d8f38bd538d668633f0a4ce5c8e67feae1.zip
Reduce database queries when rendering Custom fields box in the project settings tab (#36505).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@21411 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/projects')
-rw-r--r--app/views/projects/settings/_issues.html.erb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/views/projects/settings/_issues.html.erb b/app/views/projects/settings/_issues.html.erb
index a0f0c14d5..4fe977fb8 100644
--- a/app/views/projects/settings/_issues.html.erb
+++ b/app/views/projects/settings/_issues.html.erb
@@ -21,9 +21,10 @@
<% if User.current.admin? %>
<div class="contextual"><%= link_to l(:label_administration), custom_fields_path, :class => "icon icon-settings" %></div>
<% end %>
+ <% all_issue_custom_field_ids = @project.all_issue_custom_fields.ids %>
<% @issue_custom_fields.each do |custom_field| %>
<label class="floating">
- <%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field),
+ <%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (all_issue_custom_field_ids.include? custom_field.id),
:disabled => (custom_field.is_for_all? ? "disabled" : nil),
:id => nil %>
<%= custom_field_name_tag(custom_field) %>