list custom fields grouped by type

pull/523/head
Markus Kahl 11 years ago
parent 50ff5f6ecb
commit 307cfdb9eb
  1. 8
      app/controllers/api/v2/custom_fields_controller.rb

@ -36,12 +36,14 @@ module Api
def index
wp_fields = WorkPackageCustomField.find :all,
:include => [:translations, :projects, :types]
:include => [:translations, :projects, :types],
:order => :id
other_fields = CustomField.find :all,
:include => :translations,
:conditions => "type != 'WorkPackageCustomField'"
:conditions => "type != 'WorkPackageCustomField'",
:order => [:type, :id]
@custom_fields = (wp_fields + other_fields).sort_by(&:id)
@custom_fields = wp_fields + other_fields
respond_to do |format|
format.api

Loading…
Cancel
Save