]> source.dussan.org Git - redmine.git/commitdiff
Reduce database queries when rendering Custom fields box in the project settings...
authorGo MAEDA <maeda@farend.jp>
Mon, 14 Feb 2022 08:08:47 +0000 (08:08 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 14 Feb 2022 08:08:47 +0000 (08:08 +0000)
Patch by Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@21411 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/projects/settings/_issues.html.erb

index a0f0c14d5fd9784698bdd62778a26664dffad257..4fe977fb8e2be2a25cb43cc03cf2db0c21c0a4dc 100644 (file)
   <% 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) %>