diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-04 11:41:10 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-03-04 11:41:10 +0000 |
commit | 64d843a4d7156c94f6444e225d7606a21a312180 (patch) | |
tree | e3fddcd6135e935b2c3dc99df76a7afb66231a8f /app/models/issue.rb | |
parent | 858e317e6ebe7b9d2a30fc0eb9f304cf3565821e (diff) | |
download | redmine-64d843a4d7156c94f6444e225d7606a21a312180.tar.gz redmine-64d843a4d7156c94f6444e225d7606a21a312180.zip |
Rails 3.1 compatibility.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9073 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index eced77684..ee394a87b 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -953,11 +953,10 @@ class Issue < ActiveRecord::Base # Callback on attachment deletion def attachment_removed(obj) - journal = init_journal(User.current) - journal.details << JournalDetail.new(:property => 'attachment', - :prop_key => obj.id, - :old_value => obj.filename) - journal.save + if @current_journal && !obj.new_record? + @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :old_value => obj.filename) + @current_journal.save + end end # Default assignment based on category |