From 3d6948662e9d32947f841c282a57c58819b23e60 Mon Sep 17 00:00:00 2001 From: Marek Takac Date: Thu, 24 Jul 2014 10:50:34 +0200 Subject: [PATCH] Changed the way relation is saved in relations API --- lib/api/v3/relations/relations_api.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/api/v3/relations/relations_api.rb b/lib/api/v3/relations/relations_api.rb index 4cf9c19540..7c6eb4dd1d 100644 --- a/lib/api/v3/relations/relations_api.rb +++ b/lib/api/v3/relations/relations_api.rb @@ -19,10 +19,9 @@ module API r.delay = declared_params[:delay_id] end - if relation.valid? + if relation.valid? && relation.save model = ::API::V3::WorkPackages::RelationModel.new(relation) representer = ::API::V3::WorkPackages::RelationRepresenter.new(model, work_package: relation.to) - relation.save! representer else fail Errors::Validation.new(relation)