diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-13 09:56:58 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-13 09:56:58 +0000 |
commit | 7509dda1ff5877f36c63aab35bde4403bc23ccd9 (patch) | |
tree | 7f67f08f8ad4e9cf6707febaa26829aec2caf61a /app/models/journal.rb | |
parent | 5fbc7f8f1f66259b4161164f81891356068dfd30 (diff) | |
download | redmine-7509dda1ff5877f36c63aab35bde4403bc23ccd9.tar.gz redmine-7509dda1ff5877f36c63aab35bde4403bc23ccd9.zip |
Fixed that relations to issues that are not visible are displayed in the issue history (#1005).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12014 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/journal.rb')
-rw-r--r-- | app/models/journal.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/journal.rb b/app/models/journal.rb index c14051f83..70ecc54f5 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -53,12 +53,15 @@ class Journal < ActiveRecord::Base (details.empty? && notes.blank?) ? false : super end + # Returns journal details that are visible to user def visible_details(user=User.current) details.select do |detail| if detail.property == 'cf' field_id = detail.prop_key field = CustomField.find_by_id(field_id) field && field.visible_by?(project, user) + elsif detail.property == 'relation' + Issue.find_by_id(detail.value || detail.old_value).try(:visible?, user) else true end |