]> source.dussan.org Git - redmine.git/commitdiff
Speeds up the custom field edit view when having hundreds of projects.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 21 Jan 2016 05:15:45 +0000 (05:15 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 21 Jan 2016 05:15:45 +0000 (05:15 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@15084 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/custom_fields/_form.html.erb

index 99fffadebd686ecccedcab4336328fc1d900e0e8..7c79189acca9deacb822280ecb97cba54e3ec8ab 100644 (file)
@@ -102,8 +102,9 @@ when "IssueCustomField" %>
   </fieldset>
 
   <fieldset class="box" id="custom_field_project_ids"><legend><%= l(:label_project_plural) %></legend>
+    <% project_ids = @custom_field.project_ids.to_a %>
     <%= render_project_nested_lists(Project.all) do |p|
-      content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, @custom_field.projects.to_a.include?(p), :id => nil) + ' ' + p)
+      content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + p)
     end %>
     <%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>
     <p><%= check_all_links 'custom_field_project_ids' %></p>