diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-24 09:51:26 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-24 09:51:26 +0000 |
commit | 8f23043851708a97807f05bbd0f936ad35f65366 (patch) | |
tree | 7084d3d7eb72a32715e262babe692094b7221684 | |
parent | bc7ed1e156788bc5c823c8aa22f0d8153f5730e8 (diff) | |
download | redmine-8f23043851708a97807f05bbd0f936ad35f65366.tar.gz redmine-8f23043851708a97807f05bbd0f936ad35f65366.zip |
Dup attributes instead of issue object.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8344 e93f8b46-1217-0410-a6f0-8f06a7374b81
-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 fcfacd1a5..8e62f135e 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -397,8 +397,7 @@ class Issue < ActiveRecord::Base def init_journal(user, notes = "") @current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes) - @issue_before_change = self.clone - @issue_before_change.status = self.status + @attributes_before_change = attributes.dup @custom_values_before_change = {} self.custom_values.each {|c| @custom_values_before_change.store c.custom_field_id, c.value } # Make sure updated_on is updated when adding a note. @@ -927,13 +926,13 @@ class Issue < ActiveRecord::Base if @current_journal # attributes changes (Issue.column_names - %w(id root_id lft rgt lock_version created_on updated_on)).each {|c| - before = @issue_before_change.send(c) + before = @attributes_before_change[c] after = send(c) next if before == after || (before.blank? && after.blank?) @current_journal.details << JournalDetail.new(:property => 'attr', :prop_key => c, - :old_value => @issue_before_change.send(c), - :value => send(c)) + :old_value => before, + :value => after) } # custom fields changes custom_values.each {|c| |