summaryrefslogtreecommitdiffstats
path: root/lib
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 /lib
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 'lib')
-rw-r--r--lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb6
1 files changed, 6 insertions, 0 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 e7805cbcf..72cc30335 100644
--- a/lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb
+++ b/lib/plugins/acts_as_customizable/lib/acts_as_customizable.rb
@@ -104,6 +104,12 @@ module Redmine
@custom_field_values_changed == true
end
+ # Should the default custom field value be set for the given custom_value?
+ # By default, default custom field value is set for new objects only
+ def set_custom_field_default?(custom_value)
+ new_record?
+ end
+
def custom_value_for(c)
field_id = (c.is_a?(CustomField) ? c.id : c.to_i)
custom_values.detect {|v| v.custom_field_id == field_id }