From e4017a80056dd7bc7a84743f51b4c86000d0afe1 Mon Sep 17 00:00:00 2001 From: JonJagger Date: Sat, 21 Feb 2026 19:29:34 +0000 Subject: [PATCH] Fix duplicate key in json warning --- source/app/controllers/kata_controller.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/app/controllers/kata_controller.rb b/source/app/controllers/kata_controller.rb index e966b854e..01633a762 100644 --- a/source/app/controllers/kata_controller.rb +++ b/source/app/controllers/kata_controller.rb @@ -137,9 +137,9 @@ def revert revert: args }); light = json[:light] - light['index'] = result['next_index'] - 1 - light['major_index'] = result['major_index'] - light['minor_index'] = result['minor_index'] + light[:index] = result['next_index'] - 1 + light[:major_index] = result['major_index'] + light[:minor_index] = result['minor_index'] render json: json end @@ -162,10 +162,9 @@ def checkout summary = { colour: @colour, checkout: from } result = saver.kata_checked_out(id, index, @files, @stdout, @stderr, @status, summary) light = json[:light] - light['index'] = result['next_index'] - 1 - light['major_index'] = result['major_index'] - light['minor_index'] = result['minor_index'] - + light[:index] = result['next_index'] - 1 + light[:major_index] = result['major_index'] + light[:minor_index] = result['minor_index'] render json: json end