From 41c1230db11f279843a6409bda0c052bcf18466c Mon Sep 17 00:00:00 2001 From: Urban Rotnik Date: Wed, 17 Jun 2020 11:55:43 +0200 Subject: [PATCH] Remove position check from contorller --- app/controllers/canvas_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/canvas_controller.rb b/app/controllers/canvas_controller.rb index 35582816b..52b9ae45f 100644 --- a/app/controllers/canvas_controller.rb +++ b/app/controllers/canvas_controller.rb @@ -60,7 +60,6 @@ class CanvasController < ApplicationController positions = {} if update_params[:positions].present? poss = update_params[:positions].split(';') - center = '' (poss.collect { |pos| pos.split(',') }).each_with_index do |pos, index| unless pos.length == 3 && pos[0].is_a?(String) && float?(pos[1]) && float?(pos[2]) @@ -68,8 +67,7 @@ class CanvasController < ApplicationController end x = pos[1].to_i y = pos[2].to_i - # Multiple modules cannot have same position - return render_403 if positions.any? { |_, v| v[:x] == x && v[:y] == y } + positions[pos[0]] = { x: x, y: y } end end