summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-03-25 09:52:23 +0000
committerGo MAEDA <maeda@farend.jp>2018-03-25 09:52:23 +0000
commit6ecd71e6c7b8a2345bc3c6c862d6fa67920f2fea (patch)
treeff1c88d964a28cef3e2387699577e84f10044aa6 /app
parentd0fd3a373ef49247c4ff7f408e80b5b5304b587a (diff)
downloadredmine-6ecd71e6c7b8a2345bc3c6c862d6fa67920f2fea.tar.gz
redmine-6ecd71e6c7b8a2345bc3c6c862d6fa67920f2fea.zip
Merged r17237 from trunk to 3.4-stable (#28393).
Patch by Gregor Schmidt. git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17238 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/trackers_controller.rb2
-rw-r--r--app/views/trackers/_form.html.erb5
2 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/trackers_controller.rb b/app/controllers/trackers_controller.rb
index b0e6979c9..caf6b1165 100644
--- a/app/controllers/trackers_controller.rb
+++ b/app/controllers/trackers_controller.rb
@@ -106,6 +106,6 @@ class TrackersController < ApplicationController
return
end
@trackers = Tracker.sorted.to_a
- @custom_fields = IssueCustomField.all.sort
+ @custom_fields = IssueCustomField.sorted
end
end
diff --git a/app/views/trackers/_form.html.erb b/app/views/trackers/_form.html.erb
index 7b5b7ea61..3d71d7694 100644
--- a/app/views/trackers/_form.html.erb
+++ b/app/views/trackers/_form.html.erb
@@ -21,10 +21,11 @@
</p>
<%= hidden_field_tag 'tracker[core_fields][]', '' %>
-<% if IssueCustomField.all.any? %>
+<% @issue_custom_fields = IssueCustomField.sorted %>
+<% if @issue_custom_fields.present? %>
<p>
<label><%= l(:label_custom_field_plural) %></label>
- <% IssueCustomField.all.each do |field| %>
+ <% @issue_custom_fields.each do |field| %>
<label class="block">
<%= check_box_tag 'tracker[custom_field_ids][]',field.id, @tracker.custom_fields.to_a.include?(field), :id => nil %>
<%= field.name %>