diff --git a/app/services/projects/set_attributes_service.rb b/app/services/projects/set_attributes_service.rb index 8d64bda46d..f462098a56 100644 --- a/app/services/projects/set_attributes_service.rb +++ b/app/services/projects/set_attributes_service.rb @@ -33,10 +33,7 @@ module Projects private def set_attributes(attributes) - # Delete the status attribute which gets set by representable - # IFF the status_code is given as null - attributes.delete(:status) - status_attributes = attributes.delete(:status_attributes) || {} + status_attributes = attributes.delete(:status) || {} ret = super(attributes) diff --git a/lib/api/v3/projects/project_representer.rb b/lib/api/v3/projects/project_representer.rb index 06a5396d54..6d83682be4 100644 --- a/lib/api/v3/projects/project_representer.rb +++ b/lib/api/v3/projects/project_representer.rb @@ -50,7 +50,10 @@ module API # Representable is broken when passing nil as parameters # it will set the property :status and :statusExplanation # regardless of what the setter actually does - super.except(:status, :statusExplanation) + super.tap do |result| + result.except!(:status, :statusExplanation) + result[:status] = result.delete(:status_attributes) if result.key?(:status_attributes) + end end link :createWorkPackage,