summaryrefslogtreecommitdiffstats
path: root/app/models/custom_field.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-13 13:14:46 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-13 13:14:46 +0000
commit0a773bcbb3ecc5ae82abeb4b409e6f3225e14190 (patch)
treecb7e30383739ae0f1fba2c315d9546f9f94a9989 /app/models/custom_field.rb
parentb99a6f11f3b32f9d48efb7659e47a1ff12387311 (diff)
downloadredmine-0a773bcbb3ecc5ae82abeb4b409e6f3225e14190.tar.gz
redmine-0a773bcbb3ecc5ae82abeb4b409e6f3225e14190.zip
Fixed that validation fails when receiving an email with list custom fields (#12400).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10992 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/custom_field.rb')
-rw-r--r--app/models/custom_field.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb
index 9d40ebd7a..77441149f 100644
--- a/app/models/custom_field.rb
+++ b/app/models/custom_field.rb
@@ -160,7 +160,13 @@ class CustomField < ActiveRecord::Base
possible_values_options = possible_values_options(customized)
if possible_values_options.present?
keyword = keyword.to_s.downcase
- possible_values_options.detect {|text, id| text.downcase == keyword}.try(:last)
+ if v = possible_values_options.detect {|text, id| text.downcase == keyword}
+ if v.is_a?(Array)
+ v.last
+ else
+ v
+ end
+ end
else
keyword
end