]> source.dussan.org Git - redmine.git/commitdiff
One query is enough.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 11 Jul 2013 19:41:48 +0000 (19:41 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 11 Jul 2013 19:41:48 +0000 (19:41 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12007 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/trackers/_form.html.erb

index 9039bba683d86a3919a7643e6bd96dd20a7aa384..616f454821ad8128c0126a79d2138d6ff72300d1 100644 (file)
@@ -22,7 +22,7 @@
   <label><%= l(:label_custom_field_plural) %></label>
   <% IssueCustomField.all.each do |field| %>
     <label class="block">
-      <%= check_box_tag 'tracker[custom_field_ids][]',field.id, @tracker.custom_fields.include?(field) %>
+      <%= check_box_tag 'tracker[custom_field_ids][]',field.id, @tracker.custom_fields.to_a.include?(field) %>
       <%=h field.name %>
     </label>
   <% end %>
@@ -43,7 +43,7 @@
 <% if @projects.any? %>
 <fieldset class="box" id="tracker_project_ids"><legend><%= l(:label_project_plural) %></legend>
 <%= render_project_nested_lists(@projects) do |p|
-  content_tag('label', check_box_tag('tracker[project_ids][]', p.id, @tracker.projects.include?(p), :id => nil) + ' ' + h(p))
+  content_tag('label', check_box_tag('tracker[project_ids][]', p.id, @tracker.projects.to_a.include?(p), :id => nil) + ' ' + h(p))
 end %>
 <%= hidden_field_tag('tracker[project_ids][]', '', :id => nil) %>
 <p><%= check_all_links 'tracker_project_ids' %></p>