diff options
Diffstat (limited to 'app/models/journal.rb')
-rw-r--r-- | app/models/journal.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/journal.rb b/app/models/journal.rb index a427f84e3..71a51290b 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -31,6 +31,12 @@ class Journal < ActiveRecord::Base :type => Proc.new {|o| (s = o.new_status) ? (s.is_closed? ? 'issue-closed' : 'issue-edit') : 'issue-note' }, :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue.id, :anchor => "change-#{o.id}"}} + acts_as_activity_provider :type => 'issues', + :permission => :view_issues, + :find_options => {:include => [{:issue => :project}, :details, :user], + :conditions => "#{Journal.table_name}.journalized_type = 'Issue' AND" + + " (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')"} + def save # Do not save an empty journal (details.empty? && notes.blank?) ? false : super |