From b1df5d2f53644ea2179cf2f4098cf8444546abf9 Mon Sep 17 00:00:00 2001 From: bustikiller Date: Wed, 23 Jul 2025 11:01:38 +0200 Subject: [PATCH] Shuffle guests in WheelSwap before assigning them to new tables --- app/services/tables/wheel_swap.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/services/tables/wheel_swap.rb b/app/services/tables/wheel_swap.rb index b5171a1..fea238b 100644 --- a/app/services/tables/wheel_swap.rb +++ b/app/services/tables/wheel_swap.rb @@ -11,9 +11,10 @@ module Tables def call new_solution = @initial_solution.deep_dup - - selected_guests = new_solution.tables.map(&:pop).cycle.tap(&:next) + + selected_guests = new_solution.tables.map(&:pop).shuffle.cycle new_solution.tables.each { |table| table << selected_guests.next } + new_solution.tables.each(&:reset) new_solution end