summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-05 08:08:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-05 08:08:21 +0000
commit7a60e44d43e412fc06b0039307051ffd33380e6c (patch)
treefad9c905f623afb351ec09bcc8ce6ae9db246fc5
parent9d8209fddc39e60bd4c3c2bcc440f1f3fb9842c0 (diff)
downloadredmine-7a60e44d43e412fc06b0039307051ffd33380e6c.tar.gz
redmine-7a60e44d43e412fc06b0039307051ffd33380e6c.zip
Load only last journal with notes (#1474).
git-svn-id: http://svn.redmine.org/redmine/trunk@16370 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/issue.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 431574acd..1fd84210d 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -1083,8 +1083,7 @@ class Issue < ActiveRecord::Base
if @last_notes
@last_notes
else
- notes = self.journals.visible.where.not(notes: '').to_a
- notes.last.notes unless notes.empty?
+ journals.where.not(notes: '').reorder(:id => :desc).first.try(:notes)
end
end