summaryrefslogtreecommitdiffstats
path: root/app/models/journal.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/journal.rb')
-rw-r--r--app/models/journal.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/journal.rb b/app/models/journal.rb
index 3e846aeb8..7a36b12f1 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -1,5 +1,5 @@
-# redMine - project management software
-# Copyright (C) 2006 Jean-Philippe Lang
+# Redmine - project management software
+# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -38,6 +38,11 @@ class Journal < ActiveRecord::Base
:conditions => "#{Journal.table_name}.journalized_type = 'Issue' AND" +
" (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')"}
+ named_scope :visible, lambda {|*args| {
+ :include => {:issue => :project},
+ :conditions => Issue.visible_condition(args.first || User.current)
+ }}
+
def save(*args)
# Do not save an empty journal
(details.empty? && notes.blank?) ? false : super