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
This commit is contained in:
Jean-Philippe Lang
2012-12-13 13:14:46 +00:00
parent b99a6f11f3
commit 0a773bcbb3
4 changed files with 15 additions and 3 deletions
+7 -1
View File
@@ -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