Removed hardcoded format in API response.

git-svn-id: http://svn.redmine.org/redmine/trunk@12403 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-12-14 09:00:05 +00:00
parent ebb8e86122
commit a59dc1658b
1 changed files with 4 additions and 3 deletions

View File

@ -15,11 +15,12 @@ api.array :custom_fields do
api.default_value field.default_value api.default_value field.default_value
api.visible field.visible? api.visible field.visible?
if field.field_format == 'list' values = field.possible_values_options
if values.present?
api.array :possible_values do api.array :possible_values do
field.possible_values.each do |v| values.each do |label, value|
api.possible_value do api.possible_value do
api.value v api.value value || label
end end
end end
end end