Fix reviewer roulette when no-one is in a category
This would return `people.size` before, when it should return `nil`.
This commit is contained in:
parent
0ed961a81a
commit
60525148e7
1 changed files with 3 additions and 1 deletions
|
@ -57,10 +57,12 @@ def spin_for_person(people, random:)
|
|||
people.size.times do
|
||||
person = people.sample(random: random)
|
||||
|
||||
return person unless out_of_office?(person)
|
||||
break person unless out_of_office?(person)
|
||||
|
||||
people -= [person]
|
||||
end
|
||||
|
||||
person
|
||||
end
|
||||
|
||||
def out_of_office?(person)
|
||||
|
|
Loading…
Reference in a new issue