From 74e9139b336e42c579ef7379b915893849804354 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Sun, 28 Apr 2019 17:15:35 +0200 Subject: [PATCH] Removes unnecessary check --- app/controllers/tournaments_controller.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index e994448..d2fbc67 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -41,12 +41,10 @@ class TournamentsController < ApplicationController team_id = team[:id] team_name = team[:name] group = team[:group] - unless team_id.nil? + if team_id team = Team.find team_id put_team_into_groups_hash(groups, team, group) - end - - unless team_name.nil? + elsif team_name team = Team.create name: team_name put_team_into_groups_hash(groups, team, group) end