diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-10-13 10:04:59 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-10-13 10:04:59 +0000 |
commit | 7bea176cdb745aa5351c3836afc89ee339052125 (patch) | |
tree | 1a0e0ea0d56260bd7e26955dcd304eefb46cb0d7 /app/controllers/issues_controller.rb | |
parent | 60d6e169781e8aa40aab42c5df1f806f646d8bd0 (diff) | |
download | redmine-7bea176cdb745aa5351c3836afc89ee339052125.tar.gz redmine-7bea176cdb745aa5351c3836afc89ee339052125.zip |
Avoid lots of CustomField.find_by_id calls when displaying an issue history with custom fields (#15072).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12217 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r-- | app/controllers/issues_controller.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index ef778865d..a0f296487 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -103,6 +103,7 @@ class IssuesController < ApplicationController @journals = @issue.journals.includes(:user, :details).reorder("#{Journal.table_name}.id ASC").all @journals.each_with_index {|j,i| j.indice = i+1} @journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project) + Journal.preload_journals_details_custom_fields(@journals) # TODO: use #select! when ruby1.8 support is dropped @journals.reject! {|journal| !journal.notes? && journal.visible_details.empty?} @journals.reverse! if User.current.wants_comments_in_reverse_order? |