From f9b96cbee201c5ab322e88849a0f8f49732f5009 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Sun, 28 Apr 2019 17:18:02 +0200 Subject: [PATCH] Indicate the groups variable being changed within the method --- app/controllers/tournaments_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index d2fbc67..ffaece6 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -43,10 +43,10 @@ class TournamentsController < ApplicationController group = team[:group] if team_id team = Team.find team_id - put_team_into_groups_hash(groups, team, group) + put_team_into_groups_hash!(groups, team, group) elsif team_name team = Team.create name: team_name - put_team_into_groups_hash(groups, team, group) + put_team_into_groups_hash!(groups, team, group) end end # add groups to tournament @@ -94,7 +94,7 @@ class TournamentsController < ApplicationController private - def put_team_into_groups_hash(groups, team, group) + def put_team_into_groups_hash!(groups, team, group) if groups[group].is_a?(Array) groups[group] << team else