Indicate the groups variable being changed within the method
This commit is contained in:
parent
74e9139b33
commit
f9b96cbee2
|
|
@ -43,10 +43,10 @@ class TournamentsController < ApplicationController
|
||||||
group = team[:group]
|
group = team[:group]
|
||||||
if team_id
|
if team_id
|
||||||
team = Team.find 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
|
elsif team_name
|
||||||
team = Team.create name: 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
|
||||||
end
|
end
|
||||||
# add groups to tournament
|
# add groups to tournament
|
||||||
|
|
@ -94,7 +94,7 @@ class TournamentsController < ApplicationController
|
||||||
|
|
||||||
private
|
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)
|
if groups[group].is_a?(Array)
|
||||||
groups[group] << team
|
groups[group] << team
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue