summaryrefslogtreecommitdiffstats
path: root/app/models/custom_value.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-31 09:17:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-10-31 09:17:29 +0000
commite6112a9710cbe33a0ee5787c14498a55ce9ba891 (patch)
treecaa6adf8972bac64745faf5036379bfeb505b56e /app/models/custom_value.rb
parent9a3b8e0b1eaa6239297f53a5f1977457c28723e1 (diff)
downloadredmine-e6112a9710cbe33a0ee5787c14498a55ce9ba891.tar.gz
redmine-e6112a9710cbe33a0ee5787c14498a55ce9ba891.zip
New custom fields of existing issues are not initialized with their default value (#21074).
git-svn-id: http://svn.redmine.org/redmine/trunk@14773 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/custom_value.rb')
-rw-r--r--app/models/custom_value.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/custom_value.rb b/app/models/custom_value.rb
index ab6cc8fbc..d89bfbb13 100644
--- a/app/models/custom_value.rb
+++ b/app/models/custom_value.rb
@@ -22,7 +22,7 @@ class CustomValue < ActiveRecord::Base
def initialize(attributes=nil, *args)
super
- if new_record? && custom_field && (customized_type.blank? || (customized && customized.new_record?))
+ if new_record? && custom_field && !attributes.key?(:value)
self.value ||= custom_field.default_value
end
end