summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-25 16:23:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-01-25 16:23:22 +0000
commit3d3192b187f565ce1dcb01836d0d460467032f35 (patch)
treecaf4ebfd3cc5360698a43be8807af3ac642ade27
parent2378ed0919331f5ddfbdb1660225f879133f0495 (diff)
downloadredmine-3d3192b187f565ce1dcb01836d0d460467032f35.tar.gz
redmine-3d3192b187f565ce1dcb01836d0d460467032f35.zip
Use ids for testing inclusion.
git-svn-id: http://svn.redmine.org/redmine/trunk@16261 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/custom_fields/_form.html.erb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/views/custom_fields/_form.html.erb b/app/views/custom_fields/_form.html.erb
index 485aeb3bb..94f417cfa 100644
--- a/app/views/custom_fields/_form.html.erb
+++ b/app/views/custom_fields/_form.html.erb
@@ -90,9 +90,10 @@ when "IssueCustomField" %>
:data => {:enables => '.custom_field_role input'} %>
<%= l(:label_visibility_roles) %>:
</label>
+ <% role_ids = @custom_field.role_ids %>
<% Role.givable.sorted.each do |role| %>
<label class="block custom_field_role" style="padding-left:2em;">
- <%= check_box_tag 'custom_field[role_ids][]', role.id, @custom_field.roles.to_a.include?(role), :id => nil %>
+ <%= check_box_tag 'custom_field[role_ids][]', role.id, role_ids.include?(role.id), :id => nil %>
<%= role.name %>
</label>
<% end %>
@@ -100,10 +101,11 @@ when "IssueCustomField" %>
</fieldset>
<fieldset class="box" id="custom_field_tracker_ids"><legend><%=l(:label_tracker_plural)%></legend>
+ <% tracker_ids = @custom_field.tracker_ids %>
<% Tracker.sorted.each do |tracker| %>
<%= check_box_tag "custom_field[tracker_ids][]",
tracker.id,
- (@custom_field.trackers.to_a.include? tracker),
+ tracker_ids.include?(tracker.id),
:id => "custom_field_tracker_ids_#{tracker.id}" %>
<label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>">
<%= tracker.name %>