From fcf792615a272662b9dfa2ae7481cbad934c70c2 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sat, 28 May 2022 09:52:48 +0000 Subject: [PATCH] Issue#last_notes fallback does not respect notes visibility (#37155). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Jens Krämer. git-svn-id: https://svn.redmine.org/redmine/trunk@21613 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index ab9f794db..73fd3f8cd 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1168,7 +1168,7 @@ class Issue < ActiveRecord::Base if @last_notes @last_notes else - journals.where.not(notes: '').reorder(:id => :desc).first.try(:notes) + journals.visible.where.not(notes: '').reorder(:id => :desc).first.try(:notes) end end