diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-01-18 14:49:57 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-01-18 14:49:57 +0000 |
commit | 6fabc106964a6e33eb5f0cf779856a6b24451692 (patch) | |
tree | 8d0fd29250ca7588c7d8e332c44df4018f486968 /app/models/custom_field_value.rb | |
parent | 3a21dc6912ab6f0426dc5a59c68c571447bf9bef (diff) | |
download | redmine-6fabc106964a6e33eb5f0cf779856a6b24451692.tar.gz redmine-6fabc106964a6e33eb5f0cf779856a6b24451692.zip |
Add warning when loosing data from custom fields when bulk editing issues (#22600).
git-svn-id: http://svn.redmine.org/redmine/trunk@16224 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/custom_field_value.rb')
-rw-r--r-- | app/models/custom_field_value.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/custom_field_value.rb b/app/models/custom_field_value.rb index 38cffc0e6..eea09b289 100644 --- a/app/models/custom_field_value.rb +++ b/app/models/custom_field_value.rb @@ -52,6 +52,14 @@ class CustomFieldValue @value = custom_field.set_custom_field_value(self, v) end + def value_present? + if value.is_a?(Array) + value.any?(&:present?) + else + value.present? + end + end + def validate_value custom_field.validate_custom_value(self).each do |message| customized.errors.add(:base, custom_field.name + ' ' + message) |