From 1b2e80545a20f3dc19225991536f1c8d85c74665 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 5 Sep 2007 19:56:33 +0000 Subject: [PATCH] Fixed: custom field displayed as deleted in the issue history even if no value was set. git-svn-id: http://redmine.rubyforge.org/svn/trunk@706 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index b6eda176..827c6f70 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -86,10 +86,12 @@ class Issue < ActiveRecord::Base } # custom fields changes custom_values.each {|c| + next if (@custom_values_before_change[c.custom_field_id]==c.value || + (@custom_values_before_change[c.custom_field_id].blank? && c.value.blank?)) @current_journal.details << JournalDetail.new(:property => 'cf', :prop_key => c.custom_field_id, :old_value => @custom_values_before_change[c.custom_field_id], - :value => c.value) unless @custom_values_before_change[c.custom_field_id]==c.value + :value => c.value) } @current_journal.save unless @current_journal.details.empty? and @current_journal.notes.empty? end