eagerly load custom field translations
@ -80,7 +80,8 @@ module Api
end
def show
@planning_element = @project.work_packages.find(params[:id])
@planning_element = @project.work_packages.find params[:id],
:include => [{:custom_values => [{:custom_field => :translations}]}]
respond_to do |format|
format.api
protected
def find_project
@project = Project.find(params[:id])
@project = Project.find params[:id],
def build_associations
@ -75,6 +75,9 @@ node :assigned_to, if: lambda{|pe| pe.assigned_to.present?} do |pe|
node :custom_fields do
partial "api/v2/custom_fields/values", :object => (locals[:object] || @planning_element).custom_values
node :journals, if: lambda{|pe| include_journals?} do |pe|
pe.journals.map do |journal|
@ -82,3 +82,6 @@ node :parent, if: lambda{|project| visible_parent_project(project).present?} do
{ id: parent.id, name: parent.name, identifier: parent.identifier }
partial "api/v2/custom_fields/values", :object => (locals[:object] || @project).custom_values