summaryrefslogtreecommitdiffstats
path: root/app/models/custom_value.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2018-09-23 08:25:25 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2018-09-23 08:25:25 +0000
commite856c9f879f15f31317ddfcf35042e799b90f783 (patch)
tree7101fb598e5f2ef9aebd519bd50cf6e1fe66b30c /app/models/custom_value.rb
parent55ee0b8f7f5626197e5a3bd919b0cd56276a632e (diff)
downloadredmine-e856c9f879f15f31317ddfcf35042e799b90f783.tar.gz
redmine-e856c9f879f15f31317ddfcf35042e799b90f783.zip
Fixed that issue details page shows default values for custom fields that aren't actually set (#25726).
git-svn-id: http://svn.redmine.org/redmine/trunk@17499 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 dc511c0d7..734c76b22 100644
--- a/app/models/custom_value.rb
+++ b/app/models/custom_value.rb
@@ -23,7 +23,7 @@ class CustomValue < ActiveRecord::Base
def initialize(attributes=nil, *args)
super
- if new_record? && custom_field && !attributes.key?(:value)
+ if new_record? && custom_field && !attributes.key?(:value) && (customized.nil? || customized.set_custom_field_default?(self))
self.value ||= custom_field.default_value
end
end