From 6b82a9ef51f59d37975bd5de48142d1a0a8504de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Thu, 25 Jan 2018 12:59:52 +0100 Subject: [PATCH] Format validation errors as human readable messages --- app/controllers/groups/variables_controller.rb | 2 +- app/controllers/projects/variables_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/groups/variables_controller.rb b/app/controllers/groups/variables_controller.rb index 3a832a7c005..2f7058e95ea 100644 --- a/app/controllers/groups/variables_controller.rb +++ b/app/controllers/groups/variables_controller.rb @@ -7,7 +7,7 @@ module Groups format.json do return head :ok if @group.update(variables_params) - render status: :bad_request, json: @group.errors.to_hash + render status: :bad_request, json: @group.errors.full_messages end end end diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb index 9c0dad393c3..99dea65927d 100644 --- a/app/controllers/projects/variables_controller.rb +++ b/app/controllers/projects/variables_controller.rb @@ -6,7 +6,7 @@ class Projects::VariablesController < Projects::ApplicationController format.json do return head :ok if @project.update(variables_params) - render status: :bad_request, json: @project.errors.to_hash + render status: :bad_request, json: @project.errors.full_messages end end end