diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-27 17:54:09 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-27 17:54:09 +0000 |
commit | a774c5c48b5e596770340b6ac27ea9f0a1e1141f (patch) | |
tree | 7c0ab261c09324cbef711cba9ab3400d3c610cc2 /app/models/journal.rb | |
parent | 1721376542af256263d605a16c3981eca9e3733a (diff) | |
download | redmine-a774c5c48b5e596770340b6ac27ea9f0a1e1141f.tar.gz redmine-a774c5c48b5e596770340b6ac27ea9f0a1e1141f.zip |
Activity refactoring.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1701 e93f8b46-1217-0410-a6f0-8f06a7374b81
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 |