From a59dc1658b1da77b7d2edfdf1052111da2e8148a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 14 Dec 2013 09:00:05 +0000 Subject: Removed hardcoded format in API response. git-svn-id: http://svn.redmine.org/redmine/trunk@12403 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/custom_fields/index.api.rsb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/views/custom_fields') diff --git a/app/views/custom_fields/index.api.rsb b/app/views/custom_fields/index.api.rsb index e640f3315..4dbd44c7a 100644 --- a/app/views/custom_fields/index.api.rsb +++ b/app/views/custom_fields/index.api.rsb @@ -15,11 +15,12 @@ api.array :custom_fields do api.default_value field.default_value api.visible field.visible? - if field.field_format == 'list' + values = field.possible_values_options + if values.present? api.array :possible_values do - field.possible_values.each do |v| + values.each do |label, value| api.possible_value do - api.value v + api.value value || label end end end -- cgit v1.2.3