summaryrefslogtreecommitdiffstats
path: root/lib/plugins
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 /lib/plugins
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 'lib/plugins')
-rw-r--r--lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb b/lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb
index 9c4af77d4..6360e4e90 100644
--- a/lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb
+++ b/lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb
@@ -92,12 +92,12 @@ module Redmine
if field.multiple?
values = custom_values.select { |v| v.custom_field == field }
if values.empty?
- values << custom_values.build(:customized => self, :custom_field => field, :value => nil)
+ values << custom_values.build(:customized => self, :custom_field => field)
end
x.value = values.map(&:value)
else
cv = custom_values.detect { |v| v.custom_field == field }
- cv ||= custom_values.build(:customized => self, :custom_field => field, :value => nil)
+ cv ||= custom_values.build(:customized => self, :custom_field => field)
x.value = cv.value
end
x.value_was = x.value.dup if x.value